vue3 setup watch computed teleport Suspense useRoute useRouter
一,setup(){}1,定义变量 以及使用setup(){ let age = 20; return{ age, }}2,点击事件的方法。vue2 写入到methods中,在setup(){}中的写法<button @click="modify">按钮</button>setup(){ let age = ref(20); //使用ref点击事件的时候是响应式的 const modify = ()=>{
原创
2021-05-25 22:18:48 ·
924 阅读 ·
0 评论