From cc26637f18b8ed178420122d7335b3f89be92ada Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期四, 23 五月 2024 10:34:44 +0800
Subject: [PATCH] shujia

---
 src/views/components/dictionary.vue |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/views/components/dictionary.vue b/src/views/components/dictionary.vue
index 79c2595..6e6a1d7 100644
--- a/src/views/components/dictionary.vue
+++ b/src/views/components/dictionary.vue
@@ -60,16 +60,25 @@
 import { ref, reactive, watch, onMounted, inject } from 'vue'
 const request = inject('request')
 const props = defineProps({
-  searchCon: Boolean
+  searchCon: String
 })
 const searchContent = ref('')
 const isFull = ref(false)
 watch(props, (newValue) => {
   // 缁熺洃鍚琾rops鐨勫�煎彉鍖栵紝鍔ㄦ�佷慨鏀筰sShow鐨勫��
   searchContent.value = newValue.searchCon
+  getSearchResult()
+})
+
+onMounted(() => {
+  if(props){
+    searchContent.value = props.searchCon
+    getSearchResult()
+  }
 })
 
 const searchResult = ref([])
+
 
 const getSearchResult = () => {
   if (searchContent.value) {
@@ -81,8 +90,6 @@
         isFull: isFull.value
       }
     }).then((res) => {
-      console.log(JSON.parse(res[0].sentence)[0].sCn)
-      // encodeURIComponent(res[0].syno[0].tran)
       if (res.length > 0) {
         res.map((item) => {
           item.phrase = JSON.parse(item.phrase)

--
Gitblit v1.9.1