1. 引入
import { nextTick } from 'vue'
2. 使用
3 vue3
let updata = ref(null) // 页面渲染依赖数据
onMounted(async ()=>{
const res = await xxx() // 页面初始化请求
updata.value = res.data
await nextTick()
console.log("页面数据更新完毕了")
})
1. 引入
import { nextTick } from 'vue'
2. 使用
3 vue3
let updata = ref(null) // 页面渲染依赖数据
onMounted(async ()=>{
const res = await xxx() // 页面初始化请求
updata.value = res.data
await nextTick()
console.log("页面数据更新完毕了")
})