Close drawer when select attachment.

pull/9/head
ruibaby 2019-04-20 16:13:34 +08:00
parent a28b3e9a9a
commit 47ac79559b
3 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<div> <div>
<a-drawer <a-drawer
title="选择附件" title="选择附件"
:width="isMobile()?'100%':'580'" :width="isMobile()?'100%':drawerWidth"
closable closable
:visible="visiable" :visible="visiable"
destroyOnClose destroyOnClose
@ -68,6 +68,11 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
},
drawerWidth: {
type: Number,
required: false,
default: 580
} }
}, },
data() { data() {

View File

@ -94,7 +94,7 @@
</div> </div>
<a-divider/> <a-divider/>
</div> </div>
<AttachmentSelectDrawer v-model="childDrawerVisible" @listenToSelect="selectPostThumb"/> <AttachmentSelectDrawer v-model="childDrawerVisible" @listenToSelect="selectPostThumb" :drawerWidth="460"/>
<div class="post-control"> <div class="post-control">
<a-button style="marginRight: 8px" @click="handleDraftClick">稿</a-button> <a-button style="marginRight: 8px" @click="handleDraftClick">稿</a-button>
<a-button @click="handlePublishClick" type="primary">{{ publishText }}</a-button> <a-button @click="handlePublishClick" type="primary">{{ publishText }}</a-button>
@ -258,6 +258,7 @@ export default {
}, },
selectPostThumb(data) { selectPostThumb(data) {
this.postToStage.thumbnail = data.path this.postToStage.thumbnail = data.path
this.childDrawerVisible = false
} }
} }
} }

View File

@ -169,6 +169,7 @@ export default {
}, },
selectAvatar(data) { selectAvatar(data) {
this.user.avatar = data.path this.user.avatar = data.path
this.attachmentDrawerVisible = false
} }
} }
} }