Pārlūkot izejas kodu

兼容生词卡片拼音多余空格问题

natasha 4 dienas atpakaļ
vecāks
revīzija
45e2870016

+ 4 - 2
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -1362,7 +1362,9 @@
                                     : '',
                               }"
                             >
-                              {{ item.pinyin.split(' ')[indexh] ? item.pinyin.split(' ')[indexh] : ' ' }}
+                              {{
+                                item.pinyin.trim().split(' ')[indexh] ? item.pinyin.trim().split(' ')[indexh] : ' '
+                              }}
                             </p>
                             <Strockplay
                               v-if="itemh.hzDetail.hz_json"
@@ -1908,7 +1910,7 @@ export default {
         // }
         let flag = false;
         if (item.pinyin) {
-          flag = item.pinyin.split(' ').length === item.new_word.length;
+          flag = item.pinyin.trim().split(' ').length === item.new_word.length;
         }
         this.$set(item, 'show_left', true);
         this.$set(item, 'isFlipped', false);

+ 1 - 1
src/views/book/courseware/preview/components/new_word/components/writeTableZoom.vue

@@ -125,7 +125,7 @@
                   v-if="data.pinyin && data.pyhz"
                   :style="{ color: attrib && attrib.topic_color ? attrib.topic_color : '' }"
                 >
-                  {{ data.pinyin.split(' ')[indexh] ? data.pinyin.split(' ')[indexh] : '&nbsp;' }}
+                  {{ data.pinyin.trim().split(' ')[indexh] ? data.pinyin.trim().split(' ')[indexh] : '&nbsp;' }}
                 </p>
                 <Strockplay
                   class-name="adult-strockplay"