美文网首页
vue 更换标签title

vue 更换标签title

作者: Hello杨先生 | 来源:发表于2020-02-03 11:16 被阅读0次
    router.beforeEach(function (to, from, next) {
    
      if (!!to.meta.title) {
        document.title = to.meta.title
      }
    
    
    image.png
    <script>
      export default {
        name: 'searchEntrance',
        methods:{
          goSearch(item){
            this.$router.push(`/install/${item}`)
            //  1  消费流水查询    2  月结单查询
          },
        },
      }
    </script>
    
    created(){
    
          var id = this.$route.params.id
          console.log(id)
          if (id == 1 ) {
            document.title = '消费流水查询'
          }else if(id == 2){
            document.title = '月账单查询'
          }
    }
    
    

    相关文章

      网友评论

          本文标题:vue 更换标签title

          本文链接:https://www.haomeiwen.com/subject/nwqhxhtx.html