Vue 重置 data 数据
Vue About 294 wordsVue2
this.$data = this.$options.data()
Object.assign(this.$data, this.$options.data())
Vue3
setup () {
const initState = () => {
return {
name: 'Jason'
}
}
const state = reactive(initState())
const resetState = () => {
Object.assign(state, initState())
}
}
Views: 1,381 · Posted: 2023-01-13
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...