refactor(editor): 重构编辑器组件及样式,优化功能实现
重构编辑器工具栏样式及功能,使用wangEditor替换原有实现 优化图片和视频上传逻辑,增加自定义校验和上传处理 调整编辑器样式,修复对齐功能及段落标题样式 更新表情选择器位置逻辑,支持上下方向显示 统一组件导入方式,添加版本控制参数防止缓存
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref, inject } = Vue;
|
||||
import { like } from "../like/like.js";
|
||||
|
||||
const { like } = await import(withVer("../like/like.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemBottom = defineComponent({
|
||||
name: "item-bottom",
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemForum = defineComponent({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref, provide, onMounted, inject } = Vue;
|
||||
import { report } from "../report/report.js";
|
||||
|
||||
const { report } = await import(withVer("../report/report.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemHead = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemMj = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref, provide } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemOffer = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemSummary = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemTenement = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const itemVote = defineComponent({
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// my-component.js
|
||||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||||
const { defineComponent, ref, onMounted, nextTick } = Vue;
|
||||
import { itemBottom } from "../item-bottom/item-bottom.js";
|
||||
import { itemHead } from "../item-head/item-head.js";
|
||||
|
||||
const { itemBottom } = await import(withVer("../item-bottom/item-bottom.js"));
|
||||
const { itemHead } = await import(withVer("../item-head/item-head.js"));
|
||||
|
||||
// 定义组件(直接使用模板)
|
||||
export const latestList = defineComponent({
|
||||
|
||||
@@ -77,7 +77,14 @@ export const slideshowBox = defineComponent({
|
||||
tabPitch.value = key;
|
||||
};
|
||||
|
||||
return { tabItem, tabPitch, tabPitch, latestList };
|
||||
const handleCheckAttest = (e) => {
|
||||
if (realname.value === 0 && userInfoWin.value?.uin > 0) {
|
||||
openAttest();
|
||||
e.preventDefault(); // 阻止默认跳转(即使 href 为链接,也强制拦截)
|
||||
}
|
||||
};
|
||||
|
||||
return { handleCheckAttest, tabItem, tabPitch, tabPitch, latestList };
|
||||
},
|
||||
|
||||
template: `<div class="box-box" :class="['box-' + tabPitch]"> <div class="slideshow-box"> <div class="tab-list flexacenter"> <!-- <div class="tab-item thread" :class="{'pitch': tabPitch == 'thread'}" @click="tabItem('thread')">帖子</div> --> <div class="tab-item offer" :class="{'pitch': tabPitch == 'offer'}" @click="tabItem('offer')">Offer</div> <div class="tab-item vote" :class="{'pitch': tabPitch == 'vote'}" @click="tabItem('vote')">投票</div> <div class="tab-item interviewexperience" :class="{'pitch': tabPitch == 'interviewexperience'}" @click="tabItem('interviewexperience')">面经</div> </div> </div> <div class="slideshow-content flexflex"> <!-- 问答 --> <!-- <div class="thread-side-box side-box"> <div class="box"> <a v-for="item in latestList.thread" :key="item.uniqid" class="item" target="_blank" :href="'/details/' + item.uniqid"> <div class="question flexacenter"> <div class="text flex1 ellipsis">{{ item.title }}</div> </div> <div class="answer flexacenter"> <div class="text flex1"> <div class="texttext">{{ item.content }}</div> </div> </div> </a> <a class="add-btn flexcenter" href="https://ask.gter.net" target="_blank"> <div>more</div> <img class="" style="margin-left: 8px;" src="/img/right-arrow-black.svg"> </a> </div> </div> --> <!-- offer --> <div class="offer-side-box side-box"> <div class="box"> <a v-for="item in latestList.offer" :key="item.uniqid" class="item flexflex" :href="'/details/' + item.uniqid" target="_blank"> <img class="school-img" :src="item.data.schoollogo" /> <div class="school-detail flex1 flexflex"> <div class="school-name one-line-display">{{ item.data.schoolname }}</div> <div class="school-brief one-line-display">{{ item.data.professional }}</div> <div class="school-offer flexacenter"> <span>{{ item.data.degree }}</span> <span class="long-string">|</span> <span>{{ item.data.semester }}</span> <span class="long-string">|</span> <span>{{ item.data.apply_results_text }}</span> </div> </div> </a> <a class="add-btn flexcenter" href="https://offer.gter.net" target="_blank"> <div>more</div> <img class="" style="margin-left: 8px;" src="/img/right-arrow-black.svg"> </a> </div> </div> <!-- 投票 --> <div class="vote-side-box side-box"> <div class="box"> <a v-for="item in latestList.vote" :key="item.uniqid" class="item flexflex vuehide" target="_blank" :href="'/details/' + item.uniqid"> <div class="name one-line-display">{{ item.title }}</div> <div class="brief">{{ item.content }}</div> </a> <a class="add-btn flexcenter" href="https://vote.gter.net" target="_blank"> <div>more</div> <img class="" style="margin-left: 8px;" src="/img/right-arrow-black.svg"> </a> </div> </div> <!-- mj --> <div class="interviewexperience-side-box side-box"> <div class="box"> <a v-for="item in latestList.interviewexperience" :key="item.thread_id" class="item flexflex" :href="'/details/' + item.uniqid" target="_blank"> <div class="school one-line-display">{{ item.data.schoolname }}</div> <div class="major one-line-display">{{ item.data.project }}</div> <div class="info"> <img class="icon" :src="item.user.avatar" /> <span class="text">{{ item.title || item.content }} </span> </div> </a> <a class="add-btn flexcenter" href="https://interviewexperience.gter.net" target="_blank"> <div>more</div> <img class="" style="margin-left: 8px;" src="/img/right-arrow-black.svg"> </a> </div> </div> </div></div>`,
|
||||
|
||||
Reference in New Issue
Block a user