diff --git a/src/main.js b/src/main.js index 2c732e2..14e271b 100644 --- a/src/main.js +++ b/src/main.js @@ -5,6 +5,7 @@ import App from './App.vue' import ClientOnly from './ssr/ClientOnly.vue' import Hr from './ui/BetterHr.vue' +import Form from './ui/Form.vue' export function createApp() { const app = createSSRApp(App) @@ -13,5 +14,6 @@ export function createApp() { app .component('ClientOnly', ClientOnly) .component('Hr', Hr) + .component('Form', Form) return { app, pinia } } diff --git a/src/texts/about.md b/src/texts/about.md index dadfd89..21b2cc0 100644 --- a/src/texts/about.md +++ b/src/texts/about.md @@ -16,7 +16,7 @@ --- - MDUI 2 [mdui.org](https://mdui.org) - Vue 3 [vuejs.org](https://vuejs.org) -- Vite 6 [vitejs.dev](https://vitejs.dev) +- Vite 6 [vitejs.dev](https://vite.dev) 其他 --- diff --git a/src/ui/Form.vue b/src/ui/Form.vue new file mode 100644 index 0000000..19ef9a6 --- /dev/null +++ b/src/ui/Form.vue @@ -0,0 +1,20 @@ + + + + diff --git a/src/views/Root.vue b/src/views/Root.vue index 652c751..43dda41 100644 --- a/src/views/Root.vue +++ b/src/views/Root.vue @@ -9,8 +9,6 @@ import Intro from '../texts/intro.md' const router = useRouter() -const src = ref('') -const srcText = ref(null) const err = ref(false) function convert(from) { @@ -35,11 +33,10 @@ function convert(from) { } } -function onConvert() { - const { id, cid } = convert(src.value) +function onConvert(data) { + const { id, cid } = convert(data.src) if (id == null) { err.value = true - srcText.value?.focus() } else { err.value = false if (cid) router.push(`/work/${id}/${cid}`) @@ -56,17 +53,17 @@ function onConvert() {

链接转换

输入完整链接或者 ID

- - - 链接格式错误! +
+ + 链接格式错误!
- -> + ->
- {{ src }}
+ + +
diff --git a/src/views/Work.vue b/src/views/Work.vue index aca6ac9..66b17eb 100644 --- a/src/views/Work.vue +++ b/src/views/Work.vue @@ -120,7 +120,7 @@ function openBookmarkMenu(bk, index) { async function deleteBookmark() { if (bookmarkSelect.value) { bookmarkStore.del(bookmarkSelect.value.bk.id) - bookmarks.value.splice(bookmarkSelect.value.index) + bookmarks.value.splice(bookmarkSelect.value.index,1) bookmarkSelect.value = null } }