Browse Source

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

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/567/head
Ryan Wang 3 years ago committed by GitHub
parent
commit
4ebdce52e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/components/Category/CategoryCreateModal.vue
  2. 10
      src/components/Post/PostSettingModal.vue
  3. 10
      src/views/sheet/components/SheetSettingModal.vue
  4. 8
      src/views/sheet/independent/components/PhotoFormModal.vue

8
src/components/Category/CategoryCreateModal.vue

@ -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">
@ -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 } }
}
}
},

10
src/components/Post/PostSettingModal.vue

@ -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>
@ -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>
@ -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"
@ -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: [],

10
src/views/sheet/components/SheetSettingModal.vue

@ -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>
@ -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>
@ -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"
@ -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

8
src/views/sheet/independent/components/PhotoFormModal.vue

@ -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">
@ -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

Loading…
Cancel
Save