Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

perf: optimize the layout of some forms on mobile #564

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/Category/CategoryCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<a-modal v-model="modalVisible" :afterClose="onClose" :width="512" destroyOnClose title="新建分类">
<a-form-model
ref="categoryForm"
:label-col="{ span: 4 }"
:label-col="form.labelCol"
:model="form.model"
:rules="form.rules"
:wrapper-col="{ span: 20 }"
:wrapper-col="form.wrapperCol"
labelAlign="left"
>
<a-form-model-item help="* 页面上所显示的名称" label="名称:" prop="name">
Expand Down Expand Up @@ -76,7 +76,9 @@ export default {
slug: [{ max: 255, message: '* 分类别名的字符长度不能超过 255', trigger: ['change'] }],
thumbnail: [{ max: 1023, message: '* 封面图链接的字符长度不能超过 1023', trigger: ['change'] }],
description: [{ max: 100, message: '* 分类描述的字符长度不能超过 100', trigger: ['change'] }]
}
},
labelCol: { sm: { span: 4 }, xs: { span: 24 } },
wrapperCol: { sm: { span: 20 }, xs: { span: 24 } }
}
}
},
Expand Down
10 changes: 6 additions & 4 deletions src/components/Post/PostSettingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="card-container">
<a-tabs type="card">
<a-tab-pane key="normal" tab="常规">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="文章标题">
<a-input v-model="form.model.title" />
</a-form-item>
Expand Down Expand Up @@ -54,7 +54,7 @@
</a-form>
</a-tab-pane>
<a-tab-pane key="advanced" tab="高级">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="禁止评论">
<a-switch v-model="form.model.disallowComment" />
</a-form-item>
Expand Down Expand Up @@ -101,7 +101,7 @@
</a-form>
</a-tab-pane>
<a-tab-pane key="seo" tab="SEO">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="自定义关键词">
<a-input
v-model="form.model.metaKeywords"
Expand Down Expand Up @@ -221,7 +221,9 @@ export default {
draftSaving: false,
draftSaveErrored: false,
publishing: false,
publishErrored: false
publishErrored: false,
labelCol: { sm: { span: 4 }, xs: { span: 24 } },
wrapperCol: { sm: { span: 20 }, xs: { span: 24 } }
},

templates: [],
Expand Down
10 changes: 6 additions & 4 deletions src/views/sheet/components/SheetSettingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="card-container">
<a-tabs type="card">
<a-tab-pane key="normal" tab="常规">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="页面标题">
<a-input v-model="form.model.title" />
</a-form-item>
Expand Down Expand Up @@ -45,7 +45,7 @@
</a-form>
</a-tab-pane>
<a-tab-pane key="advanced" tab="高级">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="禁止评论">
<a-switch v-model="form.model.disallowComment" />
</a-form-item>
Expand Down Expand Up @@ -86,7 +86,7 @@
</a-form>
</a-tab-pane>
<a-tab-pane key="seo" tab="SEO">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" labelAlign="left">
<a-form :label-col="form.labelCol" :wrapper-col="form.wrapperCol" labelAlign="left">
<a-form-item label="自定义关键词">
<a-input
v-model="form.model.metaKeywords"
Expand Down Expand Up @@ -199,7 +199,9 @@ export default {
draftSaving: false,
draftSaveErrored: false,
publishing: false,
publishErrored: false
publishErrored: false,
labelCol: { sm: { span: 4 }, xs: { span: 24 } },
wrapperCol: { sm: { span: 20 }, xs: { span: 24 } }
},
templates: [],
attachmentSelectVisible: false
Expand Down
8 changes: 5 additions & 3 deletions src/views/sheet/independent/components/PhotoFormModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

<a-form-model
ref="photoForm"
:label-col="{ span: 4 }"
:label-col="form.labelCol"
:model="form.model"
:rules="form.rules"
:wrapper-col="{ span: 20 }"
:wrapper-col="form.wrapperCol"
labelAlign="left"
>
<a-form-model-item label="图片地址:" prop="url">
Expand Down Expand Up @@ -106,7 +106,9 @@ export default {
name: [{ required: true, message: '* 图片名称不能为空', trigger: ['change'] }]
},
saving: false,
saveErrored: false
saveErrored: false,
labelCol: { sm: { span: 4 }, xs: { span: 24 } },
wrapperCol: { sm: { span: 20 }, xs: { span: 24 } }
},
attachmentSelectModal: {
visible: false
Expand Down