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

Commit

Permalink
perf: optimize the layout of some forms on mobile (#565)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <i@ryanc.cc>

Co-authored-by: Ryan Wang <i@ryanc.cc>
  • Loading branch information
halo-dev-bot and ruibaby authored May 9, 2022
1 parent f17fb44 commit 607a9d3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
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

0 comments on commit 607a9d3

Please sign in to comment.