Compare commits
2 Commits
2f726f900b
...
f999ab980f
Author | SHA1 | Date | |
---|---|---|---|
f999ab980f | |||
da3529d32e |
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user