Refactor mobile style.

pull/9/head
ruibaby 2019-04-17 20:56:29 +08:00
parent b35aec4c40
commit 06c24c5abf
4 changed files with 16 additions and 40 deletions

View File

@ -85,7 +85,7 @@
<a-drawer <a-drawer
v-if="selectAttachment" v-if="selectAttachment"
title="附件详情" title="附件详情"
:width="drawerWidth" :width="isMobile()?'100%':'560'"
closable closable
:visible="drawerVisible" :visible="drawerVisible"
destroyOnClose destroyOnClose
@ -187,7 +187,6 @@ export default {
drawerVisible: false, drawerVisible: false,
detailLoading: false, detailLoading: false,
selectAttachment: null, selectAttachment: null,
drawerWidth: '560',
attachments: [], attachments: [],
editable: false, editable: false,
pagination: { pagination: {
@ -200,13 +199,6 @@ export default {
created() { created() {
this.loadAttachments() this.loadAttachments()
}, },
mounted() {
if (this.isMobile()) {
this.drawerWidth = '100%'
} else {
this.drawerWidth = '460'
}
},
methods: { methods: {
loadAttachments() { loadAttachments() {
const pagination = Object.assign({}, this.pagination) const pagination = Object.assign({}, this.pagination)

View File

@ -18,7 +18,7 @@
<a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"> <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<a-drawer <a-drawer
title="页面设置" title="页面设置"
:width="drawerWidth" :width="isMobile()?'100%':'460'"
:closable="true" :closable="true"
@close="onClose" @close="onClose"
:visible="visible" :visible="visible"
@ -103,7 +103,6 @@ export default {
xs: { span: 24 } xs: { span: 24 }
}, },
visible: false, visible: false,
drawerWidth: '460',
postUrl: 'hello-world', postUrl: 'hello-world',
customTpls: [], customTpls: [],
postToStage: {} postToStage: {}
@ -117,13 +116,6 @@ export default {
return '创建并发布' return '创建并发布'
} }
}, },
mounted() {
if (this.isMobile()) {
this.drawerWidth = '100%'
} else {
this.drawerWidth = '460'
}
},
created() { created() {
this.loadCustomTpls() this.loadCustomTpls()
}, },

View File

@ -8,11 +8,20 @@
<span slot="tab"> <span slot="tab">
<a-icon type="pushpin"/>内置页面 <a-icon type="pushpin"/>内置页面
</span> </span>
<!-- TODO 移动端展示 -->
<a-collapse :bordered="false" v-if="isMobile()">
<a-collapse-panel :header="item.name" v-for="(item,index) in internalPages" :key="index">
<p>12332112323</p>
</a-collapse-panel>
</a-collapse>
<a-table <a-table
:columns="internalColumns" :columns="internalColumns"
:dataSource="internalPages" :dataSource="internalPages"
:pagination="false" :pagination="false"
:rowKey="page => page.id" :rowKey="page => page.id"
v-else
> >
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a href="javascript:;" @click="viewPage(record.id)"></a> <a href="javascript:;" @click="viewPage(record.id)"></a>
@ -28,13 +37,6 @@
</router-link> </router-link>
</span> </span>
</a-table> </a-table>
<!-- TODO 移动端展示 -->
<a-collapse :bordered="false">
<a-collapse-panel :header="item.name" v-for="(item,index) in internalPages" :key="index">
<p>12332112323</p>
</a-collapse-panel>
</a-collapse>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="custom"> <a-tab-pane key="custom">
<span slot="tab"> <span slot="tab">
@ -50,6 +52,7 @@
</template> </template>
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js'
const internalColumns = [ const internalColumns = [
{ {
title: '页面名称', title: '页面名称',
@ -84,6 +87,7 @@ const internalPages = [
} }
] ]
export default { export default {
mixins: [mixin, mixinDevice],
data() { data() {
return { return {
internalColumns, internalColumns,

View File

@ -18,7 +18,7 @@
</a-col> </a-col>
<a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"> <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<a-drawer title="文章设置" :width="drawerWidth" closable @close="onClose" :visible="visible"> <a-drawer title="文章设置" :width="isMobile()?'100%':'460'" closable @close="onClose" :visible="visible">
<div class="post-setting-drawer-content"> <div class="post-setting-drawer-content">
<div :style="{ marginBottom: '16px' }"> <div :style="{ marginBottom: '16px' }">
<h3 class="post-setting-drawer-title">基本设置</h3> <h3 class="post-setting-drawer-title">基本设置</h3>
@ -106,7 +106,7 @@
<a-drawer <a-drawer
title="附件库" title="附件库"
:width="attachmentDrawerWidth" :width="isMobile()?'100%':'580'"
closable closable
:visible="attachmentDrawerVisible" :visible="attachmentDrawerVisible"
destroyOnClose destroyOnClose
@ -139,7 +139,7 @@
<a-drawer <a-drawer
title="附件详情" title="附件详情"
:width="selectAttachmentDrawerWidth" :width="isMobile()?'100%':'460'"
closable closable
:visible="selectAttachmentDrawerVisible" :visible="selectAttachmentDrawerVisible"
destroyOnClose destroyOnClose
@ -276,14 +276,11 @@ export default {
sm: { span: 24 }, sm: { span: 24 },
xs: { span: 24 } xs: { span: 24 }
}, },
attachmentDrawerWidth: '580',
selectAttachmentDrawerWidth: '460',
attachmentDrawerVisible: false, attachmentDrawerVisible: false,
selectAttachmentDrawerVisible: false, selectAttachmentDrawerVisible: false,
uploadVisible: false, uploadVisible: false,
visible: false, visible: false,
childDrawerVisible: false, childDrawerVisible: false,
drawerWidth: '460',
tags: [], tags: [],
categories: [], categories: [],
selectedCategoryIds: [], selectedCategoryIds: [],
@ -308,15 +305,6 @@ export default {
return '创建并发布' return '创建并发布'
} }
}, },
mounted() {
if (this.isMobile()) {
this.drawerWidth = '100%'
this.attachmentDrawerWidth = '100%'
} else {
this.drawerWidth = '460'
this.attachmentDrawerWidth = '580'
}
},
created() { created() {
this.loadTags() this.loadTags()
this.loadCategories() this.loadCategories()