Commit cd16fba5 by lijiabin

styles: 纯文本文章加入换行

parent 98e8a720
......@@ -165,8 +165,13 @@
</div>
<!-- 文章内容 -->
<div v-if="!isHtml" class="prose prose-lg max-w-none">
<div class="text-gray-700 leading-relaxed space-y-4 whitespace-pre-line text-17px">
{{ articleDetail?.content }}
<div class="text-gray-700 leading-relaxed space-y-1 text-17px">
<template v-for="(line, i) in (articleDetail?.content || '').split(/\n/)" :key="i">
<div v-if="line.trim()" class="indent-2em">
{{ line }}
</div>
<div v-else class="h-2" aria-hidden="true" />
</template>
</div>
<!-- 图片内容 -->
......
......@@ -233,7 +233,7 @@ const { play } = useAnimate(
},
)
const [form, resetForm] = useResetData({
const [form, , forReset] = useResetData({
title: '',
content: '',
imgUrl: '',
......@@ -296,7 +296,10 @@ const handlePublish = async (releaseStatus: ReleaseStatusTypeEnum) => {
await textMap[type].api(transformForm(releaseStatus))
loading.value = false
push.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功')
resetForm()
// resetForm()
forReset()
// form.value.imgUrl = ''
console.log(form.value)
} catch (error) {
console.error(error)
} finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment