【发布时间】:2021-12-26 11:46:05
【问题描述】:
https://stackoverflow.com/a/63800832/1497720
典型的监视语法是watch(<variable>, <function to handle>)
但在这个答案中:https://stackoverflow.com/a/63800832/1497720
我们有
watch(() => route.name, () => {
console.debug(`MyCoolComponent - watch route.name changed to ${route.name}`);
// Do something here...
// Optionally you can set immediate: true config for the watcher to run on init
//}, { immediate: true });
});
谁能解释一下语法是什么意思?
【问题讨论】: