Skip to content

Commit

Permalink
popup-picker: add prop:disabled #2594
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Apr 7, 2018
1 parent f97c9bb commit 21e28b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/popup-picker/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="vux-cell-box">
<div class="weui-cell vux-tap-active weui-cell_access" @click="onClick" v-show="showCell">
<div class="weui-cell vux-tap-active" :class="{'weui-cell_access': !disabled}" @click="onClick" v-show="showCell">
<div class="weui-cell__hd">
<slot name="title" label-class="weui-label" :label-style="labelStyles" :label-title="title">
<label class="weui-label" :class="labelClass" :style="labelStyles" v-if="title" v-html="title"></label>
Expand Down Expand Up @@ -141,7 +141,8 @@ export default {
},
columnWidth: Array,
popupStyle: Object,
popupTitle: String
popupTitle: String,
disabled: Boolean
},
computed: {
labelStyles () {
Expand All @@ -164,7 +165,9 @@ export default {
return value2name(this.currentValue, this.data)
},
onClick () {
this.showValue = true
if (!this.disabled) {
this.showValue = true
}
},
onHide (type) {
this.showValue = false
Expand Down
11 changes: 11 additions & 0 deletions src/components/popup-picker/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ props:
type: String
en: popup title
zh-CN: 弹窗标题
disabled:
version: next
type: Boolean
default: false
en: whether disable selecting
zh-CN: 是否禁用选择
slots:
title:
version: v2.3.7
Expand All @@ -90,6 +96,11 @@ events:
en: emits when picker value is changed
zh-CN: picker 值变化时触发,即滑动 picker 时触发
changes:
next:
en:
- '[feature] add prop:disabled #2594'
zh-CN:
- '[feature] 支持属性 disabled #2594'
v2.7.7:
en:
- '[fix] remove the first top line #2371'
Expand Down

0 comments on commit 21e28b4

Please sign in to comment.