解决vue获取不到data中属性方法

直接再计算属性中得到想要的data属性:

比如获取不到 this.$route.path,可以使用以下方法:

 computed:{
    getCurrentPath: function (){
      return '/project' + this.$route.path
    }

  

posted @ 2022-04-14 14:57  恋人星  阅读(1543)  评论(0编辑  收藏  举报