Files
PC-Light-Forum/component/hot-search/hot-search.js
A1300399510 7bdeff17f6 feat: 新增编辑页面和分享功能,优化链接跳转和样式
- 添加edit.html编辑页面及相关CSS样式
- 实现内容编辑区的富文本功能
- 为item-bottom组件添加分享功能,包括复制链接和微信转发
- 更新多个组件的链接跳转地址
- 优化CSS样式,包括圆角、阴影和hover效果
- 修复部分样式问题和布局错位
- 移除不再使用的section-index.html文件
2025-11-03 00:42:30 +08:00

30 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// my-component.js
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入Vue 已挂载到 window
const { defineComponent, ref, onMounted } = Vue;
// 定义组件(直接使用模板)
export const hotSearch = defineComponent({
name: "hot-search",
props: {},
setup(props) {
onMounted(() => {
init();
});
const init = () => {
ajaxget("/v2/api/forum/getHotSearchWords?limit=20").then((res) => {
const data = res.data;
list.value = data || [];
});
};
const list = ref([]);
return { list };
},
components: {},
template: `<div class="hot-tag" v-if="list.length > 0"> <div class="hot-tag-title"> <img class="icon" src="./img/triangle-violet.svg" /> 热门搜索 </div> <div class="list flexflex"> <a class="item" v-for="item in list" :href="'http://14.22.79.19:9551/?tpl=forum/search&kw=' + item.keyword" target="_blank">{{ item.keyword }}</a> </div></div>`,
});