feat: 新增搜索标签页面及相关功能
refactor: 优化搜索页面样式和交互逻辑 style: 调整热门标签和热门搜索组件样式 fix: 修复登录状态判断逻辑 chore: 更新图片资源和SVG图标 docs: 更新README文档 test: 添加搜索功能测试用例 build: 更新依赖包版本 ci: 配置自动化测试和部署流程 perf: 优化页面加载性能和响应速度
This commit is contained in:
@@ -1,21 +1,29 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
const { defineComponent, ref, onMounted } = Vue;
|
||||
// 定义组件(直接使用模板)
|
||||
export const hotTag = defineComponent({
|
||||
name: "hot-tag",
|
||||
props: {
|
||||
itemdata: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
props: {},
|
||||
|
||||
setup(props) {
|
||||
return {};
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
const init = () => {
|
||||
ajaxget("/v2/api/forum/getHotTags?limit=20").then((res) => {
|
||||
const data = res.data;
|
||||
list.value = data || [];
|
||||
});
|
||||
};
|
||||
|
||||
const list = ref([]);
|
||||
|
||||
return { list };
|
||||
},
|
||||
|
||||
components: {},
|
||||
|
||||
template: `<div class="hot-tag"> <div class="hot-tag-title"> <img class="icon" src="./img/triangle-orange.svg" /> 热门标签 </div> <div class="list flexflex"> <div class="item">热门标签</div> </div></div>`,
|
||||
template: `<div class="hot-tag" v-if="list.length > 0"> <div class="hot-tag-title"> <img class="icon" src="./img/triangle-orange.svg" /> 热门标签 </div> <div class="list flexflex"> <a class="item" v-for="item in list" :href="'/search-tag.html?tag=' + item.tagname" target="_blank">{{ item.tagname }}</a> </div></div>`,
|
||||
});
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<div class="hot-tag">
|
||||
<div class="hot-tag" v-if="list.length > 0">
|
||||
<div class="hot-tag-title">
|
||||
<img class="icon" src="./img/triangle-orange.svg" />
|
||||
热门标签
|
||||
</div>
|
||||
<div class="list flexflex">
|
||||
<div class="item">热门标签</div>
|
||||
<a class="item" v-for="item in list" :href="'/search-tag.html?tag=' + item.tagname" target="_blank">{{ item.tagname }}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user