vue 进入页面每次都调用methods里的方法

// 监听路由,每次进入页面调用方法,放在method里
mounted(){
  this.getPath()
},
methods: {
  getPath(){
    console.log(this.$route.path);
    if (this.$route.path == '你要进入的路由') {
    this.init() // 初始化的方法
    }
  }
},
watch: {
'$route':'getPath'
},
上一篇:Tokudb 参数优化


下一篇:phpstudy 安装 Apcahe SSL证书 实现https连接