Compare commits

...

2 Commits

Author SHA1 Message Date
f999ab980f 清除无用 2024-08-24 15:46:52 +08:00
da3529d32e 点击外缘聚焦输入 2024-08-24 14:43:52 +08:00

View File

@ -5,8 +5,8 @@ div.container.mx-auto.py-24.flex.gap-8(
) )
// (main) // (main)
main.flex.flex-1.flex-col.gap-2 main.flex.flex-1.flex-col.gap-2
// markdown // markdown()
div.flex.flex-col.gap-6.p-6(v-if="account.online") div.flex.flex-col.gap-6.p-6(v-if="account.online" @click="focusMarkdownInput()")
div.create-blog div.create-blog
textarea.w-full.rounded-md.border-gray-300.shadow-sm.px-6.py-4.transition-all.duration-150( textarea.w-full.rounded-md.border-gray-300.shadow-sm.px-6.py-4.transition-all.duration-150(
class="focus:outline-none focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50", class="focus:outline-none focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50",
@ -16,6 +16,7 @@ div.container.mx-auto.py-24.flex.gap-8(
@keydown.ctrl.enter.prevent="create" @keydown.ctrl.enter.prevent="create"
@keydown.enter="onEnter" @keydown.enter="onEnter"
@change="onChanged" @change="onChanged"
ref="markdownInput"
) )
button.px-8.py-1.bg-light-blue-100.text-light-blue-400.rounded-lg.transition-all( button.px-8.py-1.bg-light-blue-100.text-light-blue-400.rounded-lg.transition-all(
class="hover:bg-light-blue-50" class="hover:bg-light-blue-50"
@ -112,10 +113,9 @@ div.container.mx-auto.py-24.flex.gap-8(
const { data: tags, pending: tagPending } = useFetch("/api/tag", { immediate: true }) const { data: tags, pending: tagPending } = useFetch("/api/tag", { immediate: true })
const { data, pending } = useFetch("/api/blog", { const { data, pending } = useFetch("/api/blog", {
immediate: true, onResponse({ request, response, options }) { immediate: true, onResponse({ request, response, options }) {
console.log(request, response, options)
response._data = response._data.map(x => ({ response._data = response._data.map(x => ({
...x, ...x,
content: 'm' + x.content, //content: 'm' + x.content,
//html: 's' + x.html, //html: 's' + x.html,
__select: false __select: false
})) }))
@ -146,6 +146,12 @@ const editor = ref({
} }
}) })
// markdownInput
const markdownInput = ref(null)
const focusMarkdownInput = () => {
markdownInput.value.focus()
}
// class // class
const dialog = ref({ show: false, visible: false }) const dialog = ref({ show: false, visible: false })
const dialogRef = ref() const dialogRef = ref()