|
@ -2,7 +2,7 @@ |
|
|
<div class="menu" v-if="show_menu"> |
|
|
<div class="menu" v-if="show_menu"> |
|
|
<a-menu v-model:selectedKeys="current" mode="horizontal" :items="items" style="border-bottom: none;" |
|
|
<a-menu v-model:selectedKeys="current" mode="horizontal" :items="items" style="border-bottom: none;" |
|
|
@click="jumpMenu" /> |
|
|
@click="jumpMenu" /> |
|
|
<a-input-search v-model:value="searchValue" placeholder="search" style="width: 200px" @search="onSearch" /> |
|
|
|
|
|
|
|
|
<a-input-search v-model:value="searchValue" placeholder="search" style="width: 200px" @search="onSearch" :disabled="isDisabled"/> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -16,14 +16,15 @@ import { HomeOutlined, HighlightOutlined, ProfileOutlined, CameraOutlined, Userg |
|
|
import type { MenuProps } from 'ant-design-vue'; |
|
|
import type { MenuProps } from 'ant-design-vue'; |
|
|
import { get } from '@/tools/request'; |
|
|
import { get } from '@/tools/request'; |
|
|
const props = defineProps(["items", "updateCarouselVisibility"]) |
|
|
const props = defineProps(["items", "updateCarouselVisibility"]) |
|
|
const { idShow,fetchHomePageList } = homePageStore() |
|
|
|
|
|
|
|
|
const { idShow,fetchHomePageList,setEmpty } = homePageStore() |
|
|
const { show_menu } = toRefs(idShow) |
|
|
const { show_menu } = toRefs(idShow) |
|
|
const store = useContentStore(); |
|
|
const store = useContentStore(); |
|
|
const searchValue = ref("") |
|
|
const searchValue = ref("") |
|
|
const articleTitle = ref<string>(''); |
|
|
const articleTitle = ref<string>(''); |
|
|
const route = useRoute() |
|
|
const route = useRoute() |
|
|
const onSearch =async (searchValue: string) => { |
|
|
|
|
|
await fetchHomePageList(searchValue); |
|
|
|
|
|
|
|
|
const isDisabled=ref(false) |
|
|
|
|
|
const onSearch =(searchValue: string) => { |
|
|
|
|
|
fetchHomePageList(searchValue) |
|
|
}; |
|
|
}; |
|
|
const current = ref<string[]>(['home']); |
|
|
const current = ref<string[]>(['home']); |
|
|
const items = ref<MenuProps['items']>([ |
|
|
const items = ref<MenuProps['items']>([ |
|
@ -111,7 +112,20 @@ watch( |
|
|
}, |
|
|
}, |
|
|
{ immediate: true } |
|
|
{ immediate: true } |
|
|
); |
|
|
); |
|
|
|
|
|
watch(searchValue, (newValue) => { |
|
|
|
|
|
if (newValue === "") { |
|
|
|
|
|
fetchHomePageList(""); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
router.beforeEach((to, _, next) => { |
|
|
|
|
|
if (to.name !== 'home') { |
|
|
|
|
|
isDisabled.value=true; |
|
|
|
|
|
} else { |
|
|
|
|
|
isDisabled.value=false; |
|
|
|
|
|
} |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|