Skip to content

Commit

Permalink
confirm: Support prop:input-attrs (Close #1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Aug 5, 2017
1 parent 28b2cca commit 22108dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/confirm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="weui-dialog__hd" v-if="!!title"><strong class="weui-dialog__title">{{title}}</strong></div>
<div class="weui-dialog__bd" v-if="!showInput"><slot><div v-html="content"></div></slot></div>
<div v-else class="vux-prompt">
<input class="vux-prompt-msgbox" v-model="msg" :placeholder="placeholder" ref="input"/>
<input class="vux-prompt-msgbox" v-bind="inputAttrs" v-model="msg" :placeholder="placeholder" ref="input"/>
</div>
<div class="weui-dialog__ft">
<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" @click="_onCancel">{{cancelText || $t('cancel_text')}}</a>
Expand Down Expand Up @@ -72,7 +72,8 @@ export default {
closeOnConfirm: {
type: Boolean,
default: true
}
},
inputAttrs: Object
},
created () {
this.showValue = this.show
Expand Down
10 changes: 10 additions & 0 deletions src/components/confirm/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ props:
default: true
en: whether auto close when confirm button is clicked
zh-CN: 是否在点击确认按钮时自动关闭
input-attrs:
version: next
type: Object
en: input attributes
zh-CN: input 属性
slots:
default:
en: body content of the dialog
Expand All @@ -118,6 +123,11 @@ methods:
en: set input value when show-input is true
zh-CN: 设置输入值,当 show-input 为 true 时有效
changes:
next:
en:
- '[feature] Support prop:input-attrs #1799'
zh-CN:
- '[feature] 支持 prop:input-attrs 设置额外属性 #1799'
v2.5.5:
en:
- '[feature] Add method:setInputValue #1746'
Expand Down
1 change: 1 addition & 0 deletions src/demos/Confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<confirm v-model="show3"
show-input
:title="$t('confirm deleting the item')"
:input-attrs="{type: 'number'}"
@on-cancel="onCancel"
@on-confirm="onConfirm"
@on-show="onShow"
Expand Down

0 comments on commit 22108dc

Please sign in to comment.