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