Ver Fonte

处理协议内容不换行bug

huangbin há 4 anos atrás
pai
commit
fb59ce27c8
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      src/views/account/login.vue

+ 5 - 2
src/views/account/login.vue

@@ -79,7 +79,7 @@
             :footer="null"
             width="890px"
         >
-            <p class="agreement-content">{{ selectedAgreement.agreementcontent }}</p>
+            <div class="agreement-content" v-html="formateWord(selectedAgreement.agreementcontent)"></div>
         </a-modal>
     </div>
 </template>
@@ -142,6 +142,9 @@ function useAgreement() {
     const closeModel = () => {
         visible.value = false
     }
+    const formateWord = (val: string) => {
+        return val.replace(/\n/g, '<br>')
+    }
     initData(() => {
         queryUserNodeCfgAndStatus({ nodetype: '2', agreementtype: 2 }).then(res => {
             if (Array.isArray(res)) {
@@ -150,7 +153,7 @@ function useAgreement() {
             }
         })
     })
-    return { agreementList, showModal, selectedAgreement, visible, closeModel }
+    return { agreementList, showModal, selectedAgreement, visible, closeModel, formateWord }
 }
 export default defineComponent({
     name: 'login',