no message
This commit is contained in:
64
js/search.js
64
js/search.js
@@ -1,23 +1,71 @@
|
||||
const { createApp, ref, onMounted, nextTick, onUnmounted, computed, watch, provide } = Vue;
|
||||
import { itemForum } from "../component/item-forum/item-forum.js";
|
||||
import { headTop } from "../component/head-top/head-top.js";
|
||||
import { hotTag } from "../component/hot-tag/hot-tag.js";
|
||||
|
||||
const appSearch = createApp({
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
const params = getUrlParams();
|
||||
const id = params.section || "";
|
||||
if (id) {
|
||||
section.value = id;
|
||||
init();
|
||||
}
|
||||
|
||||
section.value = id;
|
||||
|
||||
// init();
|
||||
});
|
||||
|
||||
return {};
|
||||
const classifyList = ref([
|
||||
{
|
||||
text: "全部",
|
||||
type: "",
|
||||
},
|
||||
{
|
||||
text: "帖子",
|
||||
type: "thread",
|
||||
},
|
||||
{
|
||||
text: "Offer",
|
||||
type: "offer",
|
||||
},
|
||||
{
|
||||
text: "总结",
|
||||
type: "offer_summary",
|
||||
},
|
||||
{
|
||||
text: "面经",
|
||||
type: "interviewexperience",
|
||||
},
|
||||
{
|
||||
text: "投票",
|
||||
type: "vote",
|
||||
},
|
||||
{
|
||||
text: "租房",
|
||||
type: "tenement",
|
||||
},
|
||||
]);
|
||||
|
||||
let classify = ref("");
|
||||
|
||||
const classifyChange = (type) => {
|
||||
if (classify.value == type) return;
|
||||
|
||||
classify.value = type;
|
||||
};
|
||||
|
||||
let tabList = ref({
|
||||
all: "全部",
|
||||
thread: "论坛",
|
||||
offer: "Offer",
|
||||
offer_summary: "总结",
|
||||
interviewexperience: "面经",
|
||||
vote: "投票",
|
||||
});
|
||||
|
||||
let tabValue = ref("all");
|
||||
|
||||
return { tabValue, tabList, classifyChange, classifyList, classify };
|
||||
},
|
||||
});
|
||||
appSearch.component("item-forum", itemForum);
|
||||
appSearch.mount("#sectionIndex");
|
||||
appSearch.component("head-top", headTop);
|
||||
appSearch.component("hot-tag", hotTag);
|
||||
appSearch.mount("#search");
|
||||
|
||||
Reference in New Issue
Block a user