3 Commits

Author SHA1 Message Date
2aea1eae7f [Feature]
All checks were successful
Node.js CI / build-and-test (push) Successful in 24s
为 SSR 的导航菜单添加链接
2025-05-16 09:31:13 +08:00
063a1330d7 [Feature]
All checks were successful
Node.js CI / build-and-test (push) Successful in 31s
为 Markdown 启用自定义 Hr 组件
2025-05-16 09:01:11 +08:00
0607e6241b [BugFix]
All checks were successful
Node.js CI / build-and-test (push) Successful in 25s
修复链接转换器不显示格式错误的 BUG
2025-05-14 18:00:56 +08:00
3 changed files with 13 additions and 6 deletions

View File

@ -98,7 +98,7 @@ onMounted(async () => {
<li v-for="item in routeStore.allRoutes"
:key="item.path"
:class="{ 'active-item' : item.path == $route.path }"
>{{ item.name }}</li>
><a :href="item.path">{{ item.name }}</a></li>
</ul>
</template></ClientOnly>
</nav>

View File

@ -10,10 +10,12 @@ import Intro from '../texts/intro.md'
const router = useRouter()
const err = ref(false)
const srcText = ref(null)
function convert(from) {
if( Number(from) ) {
return {
type: 's',
id: Number(from)
}
} else if (from.includes('https://archiveofourown.org/works/')) {
@ -34,9 +36,11 @@ function convert(from) {
}
function onConvert(data) {
const { id, cid } = convert(data.src)
if (id == null) {
const { type, id, cid } = convert(data.src)
console.log(type, id, cid)
if (type == null) {
err.value = true
srcText.value?.focus()
} else {
err.value = false
if (cid) router.push(`/work/${id}/${cid}`)
@ -54,7 +58,7 @@ function onConvert(data) {
<h2>链接转换</h2>
<p>输入完整链接或者 ID</p>
<Form @submit="onConvert"><ClientOnly>
<mdui-text-field variant="filled" label="链接" name="src" placeholder="https://archiveofourown.org/works/114514" >
<mdui-text-field variant="filled" label="链接" name="src" placeholder="https://archiveofourown.org/works/114514" ref='srcText'>
<span v-if='err' slot="helper" class='warn-text'>链接格式错误!</span>
</mdui-text-field><br/>
<div style="display: flex">

View File

@ -19,8 +19,11 @@ export default defineConfig({
}),
vueJsx(),
vueDevTools(),
markdown()
markdown({
markdownItSetup(md) {
md.renderer.rules.hr = () => "<Hr />"
}
})
],
resolve: {
alias: {