Browse Source

remove html tag in destination detail page

fengchang 1 year ago
parent
commit
e447ee3458
1 changed files with 8 additions and 1 deletions
  1. 8 1
      hichina-main-front/src/views/destination/detail.vue

+ 8 - 1
hichina-main-front/src/views/destination/detail.vue

@@ -25,7 +25,7 @@
 
         <div class="content flex-item">
           <p class="title">{{ item.destinationName }}</p>
-          <p class="mt-50">{{ item.description }}</p>
+          <p class="mt-50">{{ removeHtmlTag(item.description) }}</p>
         </div>
       </div>
     </div>
@@ -73,6 +73,13 @@
 
   const route = useRoute()
 
+  function removeHtmlTag(input){
+    var div = document.createElement("div");
+    div.innerHTML = input;
+    var text = div.textContent || div.innerText || "";
+    return text;
+  }
+
   function loadDestinations(){
     AXIOS.get('/api/public/destination/'+route.params.destinationId).then(response=>{
        console.log("destination detail: ")