vue3的监听跟vue2有点不一样.
引入watch后直接在setup里面使用, 调用方式是以回调函数的方式呈现.
1.先引入watch
import {
ref, defineComponent, watch } from "vue";
2.在setup里面引用
/*监听props*/
watch(props,(newProps, oldProps) => {
showMo
vue3的监听跟vue2有点不一样.
引入watch后直接在setup里面使用, 调用方式是以回调函数的方式呈现.
1.先引入watch
import {
ref, defineComponent, watch } from "vue";
2.在setup里面引用
/*监听props*/
watch(props,(newProps, oldProps) => {
showMo