import { watch } from "vue";
export default {
props: {
items: {
type: Array,
require: true
}
},
setup(props) {
watch(
() => props.items,
(val) => {
if (val.length > 4) {
console.log(12222);
}
}
);
}
};
vue3 watch监听props里的属性
最新推荐文章于 2024-04-23 10:04:21 发布