当传参是直接赋值而不是通过变量传参时会触发该问题
即
<video-source sourceId="videoid" :urls="videoUrls" :coordinates="[
[127.1650464 - 0.01, 45.74138 + 0.01],
[127.1650464 + 0.01, 45.74138 + 0.01],
[127.1650464 + 0.01, 45.74138 - 0.01],
[127.1650464 - 0.01, 45.74138 - 0.01],
]" :clip="[[0,0],[0,1]...]" />
这样当我在修改videoUrls的值时,coordinates和clip就会同时触发监听事件
watch(
() => props.clip,
(newVal) => {
console.log(1);
}
);
watch(
() => props.coordinates,
(newVal) => {
console.log(2);
}
);
watch(
() => props.urls,
(newVal) => {
console.log(3);
}
);
但如果修改为变量传参就不会有这个问题
<video-source sourceId="videoid" :coordinates="datalist" :clip="cliplist" />