We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当在编辑或者详情弹窗中,使用了 optionApi加载异步接口时,接口会多次重复调用。
The text was updated successfully, but these errors were encountered:
因为在template的模板中使用方法渲染,会触发vue两个阶段的声明周期函数,分别是在beforeMount 和mounted中间会执行一次。以及beforeUpdate 和 updated中间会执行一次
Sorry, something went wrong.
怎么解决啊
怎么解决啊 因为这是template的默认渲染规则,避免不了。只要是在template中,使用方法的方式进行渲染,就会存在两次调用。 我的解决方案是:将需要在template进行optionapi方法调用,进行渲染的接口数据,比如字典。让这个接口提前在setup中调用,然后把数据返回值保存起来,在需要用的地方,只是获取这个数据,而不是在调用接口,然后进行数据渲染。
怎么解决啊 这里提前调用,然后缓存返回的字典值,加了个value字段存储。 这里直接取数据。
还有一种方案,就是用回老方法,不用tsx。
No branches or pull requests
当在编辑或者详情弹窗中,使用了 optionApi加载异步接口时,接口会多次重复调用。
The text was updated successfully, but these errors were encountered: