1、引入
javascript
import { nextTick } from 'vue'
2、具体使用,配合异步
javascript
setup() {
const message = ref('Hello!')
const changeMessage = async newMessage => {
message.value = newMessage
await nextTick()
console.log('Now DOM is updated')
}
}
3、具体使用,普通
方法里:
javascript
setup () {
let otherParam = reactive({
showA:false
})
nextTick(()=>{
otherParam.showA = true
})
return {
otherParam
}
}