watch初始化执行一次

    watch: {
        msg: {
            //初始化的时候执行一次
            immediate: true,
            handler: function (oldValue, newValue) {
                console.log(oldValue, newValue);
                this.allmsg = oldValue + '111';
            }
        }
    },
发布了39 篇原创文章 · 获赞 2 · 访问量 4023

猜你喜欢

转载自blog.csdn.net/qq_43137725/article/details/103817571