Vue 重置 data 数据
Vue 大约 294 字Vue2
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())
}
}
阅读 304 · 发布于 2023-01-13
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Spring Boot JPA 控制台输出格式化后的 SQL 语句阅读 4728
-
Spring Boot @Scheduled 定时任务阅读 4427
-
JavaScript 获取本地局域网 IP 地址阅读 6364
-
算法:希尔排序阅读 834
-
IDEA CodeGlance 插件长文件中快速滑动阅读 678
-
GoJS 浏览器窗口缩放后自动居中对齐阅读 1650
-
Linux Vim 取消粘贴时自动注释和自动缩进阅读 3649
-
Linux 之校准服务器时间阅读 2642
-
MongoDB 连接远程数据库阅读 2704
-
minikube 安装 Kubernetes ingress 插件报错 timed out waiting for the condition阅读 1338