beforeRouteEnter(to, from, next) {
next((vm) => {
vm.set_title("xxxxx");
});
},
beforeRouteLeave(to, from, next) {
this.set_title("xxxxx");
next();
},
mounted() {
this.routed();
},
// 打电话
telPhone(value) {
location.href = "tel:" + value;
},
//时间格式兼容 安卓和苹果端
具体表现:字符串转时间,如果出现'-',ios不能识别,例如 Date.parse('2019-9-4 11:17:21')--在ios中会报错
解决方法:把'-'转成'/',
date.replace(/-/g,'/');
解决方法:把'-'转成'/',
date.replace(/-/g,'/');
this.$nextTick(() => {
this.scrollTop = val;
this.$forceUpdate();
});
that.$forceUpdate();
个人建议用下面这一个