瀏覽代碼

字段修改

黄琪勇 2 月之前
父節點
當前提交
b794cbd5e0
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/views/components/element/cloudCoachElement/cloudCoachList/cloudCoachList.vue

+ 3 - 3
src/views/components/element/cloudCoachElement/cloudCoachList/cloudCoachList.vue

@@ -111,7 +111,7 @@
                     <img v-if="item.sourceFrom === 'PLATFORM'" class="jxImg" src="./imgs/jx.png" alt="" />
                   </div>
                   <div class="musicInfo">
-                    <EllipsisScroll class="musicTit" :title="item.name || ''" />
+                    <EllipsisScroll class="musicTit" :title="item.highName || ''" />
                     <div class="info">
                       <div class="hotInfo" v-if="item.usedNum">
                         <img src="./imgs/hot.png" alt="" />
@@ -401,7 +401,7 @@ function handleGetQuery() {
     }
     if (res.code === 200) {
       musicList.value = res.data.rows.map((item: any) => {
-        item.name = highlightedText(item.name, queryData.name)
+        item.highName = highlightedText(item.name, queryData.name)
         return item
       })
       queryData.total = res.data.total
@@ -431,7 +431,7 @@ const highlightedText = (text: string, query: string) => {
   if (!query) {
     return text
   }
-  const regex = new RegExp(`(${queryData.name})`, "gi")
+  const regex = new RegExp(`(${query})`, "gi")
   return text.replace(regex, '<span class="highlighted">$1</span>')
 }
 </script>