Refactor PostSetting.vue.

pull/3445/head
ruibaby 2019-09-06 23:42:56 +08:00
parent 357cd7cee9
commit ab6b070d93
1 changed files with 27 additions and 1 deletions

View File

@ -31,10 +31,31 @@
<a-input v-model="selectedPost.url" />
</a-form-item>
<a-form-item label="访问密码:">
<a-input
v-model="selectedPost.password"
v-if="passwordVisible"
>
<a
href="javascript:void(0);"
slot="addonAfter"
@click="togglePasswordVisible"
>
<a-icon type="eye" />
</a>
</a-input>
<a-input
type="password"
v-model="selectedPost.password"
/>
v-else
>
<a
href="javascript:void(0);"
slot="addonAfter"
@click="togglePasswordVisible"
>
<a-icon type="eye-invisible" />
</a>
</a-input>
</a-form-item>
<a-form-item label="发表时间:">
@ -218,6 +239,7 @@ export default {
thumbDrawerVisible: false,
categoryFormVisible: false,
settingLoading: true,
passwordVisible: false,
selectedPost: this.post,
selectedTagIds: this.tagIds,
selectedCategoryIds: this.categoryIds,
@ -395,8 +417,12 @@ export default {
})
}
},
togglePasswordVisible() {
this.passwordVisible = !this.passwordVisible
},
onClose() {
this.$emit('close', false)
this.passwordVisible = false
},
onPostDateChange(value, dateString) {
this.selectedPost.createTime = value.valueOf()