mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 15:10:59 +08:00
fix: add link logo, 以及跳转新窗口
This commit is contained in:
@@ -9,14 +9,12 @@
|
||||
title="收起至 100px"
|
||||
@click="collapseToMini"
|
||||
></i>
|
||||
<!-- 回弹:60vh -->
|
||||
<i
|
||||
class="fas fa-chevron-up"
|
||||
v-if="floatHeight !== DEFAULT_HEIGHT"
|
||||
title="回弹至 60vh"
|
||||
@click="reboundToDefault"
|
||||
></i>
|
||||
<!-- 全屏打开(原有逻辑) -->
|
||||
<i class="fas fa-expand" title="在页面中打开" @click="expand"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,7 +59,6 @@ function injectBaseTag() {
|
||||
}
|
||||
}
|
||||
|
||||
// 当浮窗重新出现时,恢复默认高度
|
||||
watch(
|
||||
() => floatRoute.value,
|
||||
(v) => {
|
||||
@@ -76,7 +73,6 @@ watch(
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 400px;
|
||||
/* 高度由内联样式绑定控制:60vh / 100px */
|
||||
max-height: 90vh;
|
||||
background-color: var(--background-color);
|
||||
border: 1px solid var(--normal-border-color);
|
||||
|
||||
@@ -106,7 +106,7 @@ const md = new MarkdownIt({
|
||||
|
||||
md.use(mentionPlugin)
|
||||
md.use(tiebaEmojiPlugin)
|
||||
md.use(linkPlugin) // 添加链接插件
|
||||
md.use(linkPlugin)
|
||||
|
||||
export function renderMarkdown(text) {
|
||||
return md.render(text || '')
|
||||
|
||||
@@ -16,6 +16,7 @@ export function createVditor(editorId, options = {}) {
|
||||
const { placeholder = '', preview = {}, input, after } = options
|
||||
const config = useRuntimeConfig()
|
||||
const API_BASE_URL = config.public.apiBaseUrl
|
||||
const WEBSITE_BASE_URL = config.public.websiteBaseUrl
|
||||
|
||||
const fetchMentions = async (value) => {
|
||||
if (!value) {
|
||||
@@ -80,7 +81,7 @@ export function createVditor(editorId, options = {}) {
|
||||
}))
|
||||
},
|
||||
},
|
||||
vditorPostCitation(API_BASE_URL),
|
||||
vditorPostCitation(API_BASE_URL, WEBSITE_BASE_URL),
|
||||
],
|
||||
},
|
||||
cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor',
|
||||
|
||||
@@ -10,7 +10,7 @@ async function searchPost(apiBaseUrl, keyword) {
|
||||
})
|
||||
}
|
||||
|
||||
export default (apiBaseUrl) => {
|
||||
export default (apiBaseUrl, websiteBaseUrl) => {
|
||||
return {
|
||||
key: '#',
|
||||
hint: async (keyword) => {
|
||||
@@ -22,8 +22,8 @@ export default (apiBaseUrl) => {
|
||||
let value = ''
|
||||
return (
|
||||
body.map((item) => ({
|
||||
value: `[${item.title}](/posts/${item.id})`,
|
||||
html: `<div>${item.title}</div>`,
|
||||
value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`,
|
||||
html: `<div><i class="fas fa-link"></i> ${item.title}</div>`,
|
||||
})) ?? []
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user