Skip to content

Commit

Permalink
feat(OrInputDialog): 增加关闭时是否保留输入内容prop keepInputOnClose
Browse files Browse the repository at this point in the history
  • Loading branch information
1962247851 committed May 5, 2023
1 parent 572909c commit fe0c037
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/or/OrInputDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
export default {
name: 'OrInputDialog',
props: {
/**
* 关闭时是否保留输入
*/
keepInputOnClose: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
Expand Down Expand Up @@ -100,7 +107,9 @@ export default {
return this.$refs.form.validate()
},
onClose () {
this.input = ''
if (!this.keepInputOnClose) {
this.input = ''
}
this.$emit('onClose')
}
}
Expand Down

0 comments on commit fe0c037

Please sign in to comment.