<script setup>
import { watch, defineProps, reactive } from "vue"
const props = defineProps({
'nodeId': {
type: Number,
required: true,
},
})
const initState = {
connectionList: {},
}
const state = reactive(initState);
watch(
() => props.nodeId,
(newVal, oldVal)=> {
console.log('nodeId changed', oldVal, newVal)
},
)
watch(
() => state.connectionList,
(newVal, oldVal)=> {
console.log('state.connectionNumEchartList changed', oldVal, newVal)
},
)
</script>
<script setup>如何使用多个 watch
最新推荐文章于 2024-02-27 14:23:27 发布