想在函数调用时统一添加埋点事件tranck(),但是不想每个都手动添加,希望通过监听重写的方式自动写入,请问各位大佬前辈们,这可以实现吗
methods: {
//页面跳转
gotoPage(path, data = {}) {
// this.tranck(path,data);// 方法调用前调用
this.$router.push({
name: path,
query: data
});
},
// 登录
_LoginByOpenId(uuId) {
// this.tranck(uuId);// 方法调用前调用
LoginByToken({
uuId:uuId,
userId: localStorage['token']
})
.then(res => {
if (res.status === 0) {
this.LOGIN_INFO(true);
} else {
this.LOGIN_INFO(false);
localStorage.removeItem('token');
}
})
.catch(error => {
console.log('--------------' + error);
});
},
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…