Browse Source

新增搜索结果页、帮助中心浏览器标题

yangc 8 years ago
parent
commit
fd7b2a9b96
2 changed files with 18 additions and 0 deletions
  1. 15 0
      layouts/default.vue
  2. 3 0
      layouts/main.vue

+ 15 - 0
layouts/default.vue

@@ -15,6 +15,21 @@
       HeaderView: Header,
       FooterView: Footer,
       RightBar
+    },
+    head () {
+      return {
+        title: this.title
+      }
+    },
+    computed: {
+      title () {
+        let path = this.$route.path
+        if (path.startsWith('/help')) {
+          return '帮助中心-优软商城'
+        } else {
+          return '【优软商城】IC电子元器件现货采购交易平台商城'
+        }
+      }
     }
   }
 </script>

+ 3 - 0
layouts/main.vue

@@ -32,6 +32,7 @@
     computed: {
       title () {
         let path = this.$route.path
+        console.log(path)
         if (path === '/product/kind/home') {
           return '电子元器件器件选型参数型号查询器件类别分类大全'
         } else if (path.startsWith('/product/kind/')) {
@@ -50,6 +51,8 @@
           return 'IC电子元器件行业市场资讯新闻'
         } else if (path.startsWith('/news/')) {
           return this.newsDetail.title
+        } else if (path.startsWith('/search')) {
+          return this.$route.query.w + '-产品搜索-优软商城'
         } else {
           return '【优软商城】IC电子元器件现货采购交易平台商城'
         }