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

View File

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

View File

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