Quellcode durchsuchen

feat: tag的输入更人性化
1. tag标签的输入支持使用, , ;等进行分割

kindring vor 1 Jahr
Ursprung
Commit
e8d2848594

+ 1 - 0
components/typeEdit.vue

@@ -83,6 +83,7 @@ export default {
       }
       // 去除空字符串
       tags = tags.replace(/\s/g,'')
+      tags = tags.replace(/,|;/g,',')
       let tagArr = tags.split(',')
       // 标签去重
       tagArr = [...new Set(tagArr)]

+ 1 - 0
pages/manger/news/type.vue

@@ -105,6 +105,7 @@ export default {
       }
       // 去除空字符串
       tags = tags.replace(/\s/g,'')
+      tags = tags.replace(/,|;/g,',')
       let tagArr = tags.split(',')
       // 标签去重
       tagArr = [...new Set(tagArr)]

+ 2 - 0
pages/manger/product/add.vue

@@ -122,7 +122,9 @@ export default {
       }
       // 去除空字符串
       tags = tags.replace(/\s/g,'')
+      tags = tags.replace(/,|;/g,',')
       let tagArr = tags.split(',')
+
       // 标签去重
       tagArr = [...new Set(tagArr)]
       // 移除空标签

+ 2 - 0
pages/manger/product/type.vue

@@ -155,6 +155,8 @@ export default {
       }
       // 去除空字符串
       tags = tags.replace(/\s/g,'')
+      tags = tags.replace(/,|;/g,',')
+      // 同时兼容 , 和 ,
       let tagArr = tags.split(',')
       // 标签去重
       tagArr = [...new Set(tagArr)]

+ 4 - 1
pages/product/info/index.vue

@@ -26,7 +26,10 @@
           <div class="buy-fn" v-if="productDetail.shop_addr||platform.shop_addr">
             <div class="fn-name">网店购买</div>
             <div class="fn-show">
-              <a :href="productDetail.shop_addr?productDetail.shop_addr:platform.shop_addr" trget="_blank">打开网店</a>
+              <a target="_blank"
+                 rel="noopener noreferrer"
+                 :href="productDetail.shop_addr?productDetail.shop_addr:platform.shop_addr"
+                 >打开网店</a>
             </div>
           </div>
           <div class="buy-fn">