博星卓越网站建设实验代码,装酷网装修平台,最大的建筑招工平台 app,百度代做seo排名原因#xff1a;Promise是异步的#xff0c;如果业务逻辑不放在then内部#xff0c;那么可能时机无法拿到then内返回的变量。
解决方案#xff1a;Vueuse库提供了异步计算属性的钩子#xff0c;使用Vueuse库的computedAsync即可。
import { computedAsync } from vueuse…原因Promise是异步的如果业务逻辑不放在then内部那么可能时机无法拿到then内返回的变量。
解决方案Vueuse库提供了异步计算属性的钩子使用Vueuse库的computedAsync即可。
import { computedAsync } from vueuse/corelet getUri computedAsync(async () {let Uri await userGetUri().then((res){Uri res[data]})return Uri})
建议异步操作还是放在Store的Action里面通过async/await方式串行化执行。