diff --git a/components/i/search/Header.vue b/components/i/search/Header.vue index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7dc1ed4625840199a6a1602019afe5af41e7bbcb 100644 --- a/components/i/search/Header.vue +++ b/components/i/search/Header.vue @@ -0,0 +1,54 @@ + + + + + + {{ editTitle }} + + + / + 收藏 + + + 收藏 + 分享 + + + + + + \ No newline at end of file diff --git a/composables/useFetchRequest.js b/composables/useFetchRequest.js index 91c9e6d56ad427397bf787ae258901b5031067e9..6903e1ad91dae8f0e1fa44b9560e84d03693ef82 100644 --- a/composables/useFetchRequest.js +++ b/composables/useFetchRequest.js @@ -5,7 +5,7 @@ const useFetchRequest = (baseUrl) => { headers: {} } const fetchRequest = (url, fetchConfig) => { - url = `${BASE_URL}${url}` + url = `${baseUrl}${url}` fetchConfig = fetchConfig || {} fetchConfig.method = (fetchConfig.method || 'get').toLocaleUpperCase() fetchConfig = Object.assign(config, fetchConfig) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index ec656e6641bcfe02f9cc62c6931f2a914a639bca..93d36d922508c4cffd36210b8147be96bf98fbb3 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -1,28 +1,6 @@ - - - - - {{ state.query }} - - - / - 收藏 - - - 收藏 - 分享 - - - - + {{ state.query }} @@ -76,7 +54,9 @@ const state = reactive({ useHead({ title: `${state.query} - GitBot` }) - +function handleUpdateQuery(query) { + state.query = query; +} // 是否停止自动滚动到底部 const isAutoToBottom = ref(true) const handleScroll = (event, params) => { @@ -96,22 +76,6 @@ const scrollToView = () => { const height = $target.clientHeight y.value = height } -const isEditTitle = ref(false) -const titleRef = ref(null) -const handleFocusTitle = () => { - isEditTitle.value = true -} -const handleBlurTitle = () => { - isEditTitle.value = false -} -function handleShare () { - useCopyToClipboard().copy(window.location.href) - toast.add({ - icon: 'i-heroicons-information-circle-20-solid', - timeout: 2000, - title: '链接已复制到剪贴板' - }) -} const handleReGenerate = (index) => { editIndex.value = index const question = data.value[editIndex.value].question @@ -127,7 +91,6 @@ const data = ref([ { question: state.query, desLoading: true } ]) const recommendQuestions = ref([]) -const continueQuestion = ref(null) // git url const baseGitUrl = computed(() => { const endWidthGit = state.gitPath.endsWith('.git') @@ -239,7 +202,7 @@ const fetchLinkedQuestion = (query) => { }).then((res) => { if (res && res.data && res.data.items) { recommendQuestions.value = res.data.items.map(item => { - return { title: item } + return { title: item.question } }) } })