| | |
| | | <template> |
| | | <view class="uni-popup-dialog"> |
| | | <view class="uni-popup-dialog" :style="{ borderRadius }"> |
| | | <view class="uni-dialog-title"> |
| | | <text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{titleText}}</text> |
| | | </view> |
| | |
| | | focus: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | borderRadius: { |
| | | type: String, |
| | | default: '11px', |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | } |
| | | }, |
| | | value(val) { |
| | | if (this.maxlength != -1 && this.mode === 'input') { |
| | | this.val = val.slice(0, this.maxlength); |
| | | } else { |
| | | this.val = val |
| | | } |
| | | this.setVal(val) |
| | | }, |
| | | // #ifdef VUE3 |
| | | modelValue(val) { |
| | | this.setVal(val) |
| | | }, |
| | | // #endif |
| | | val(val) { |
| | | // #ifdef VUE2 |
| | | // TODO 兼容 vue2 |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | /** |
| | | * 给val属性赋值 |
| | | */ |
| | | setVal(val) { |
| | | if (this.maxlength != -1 && this.mode === 'input') { |
| | | this.val = val.slice(0, this.maxlength); |
| | | } else { |
| | | this.val = val |
| | | } |
| | | }, |
| | | /** |
| | | * 点击确认按钮 |
| | | */ |
| | |
| | | <style lang="scss"> |
| | | .uni-popup-dialog { |
| | | width: 300px; |
| | | border-radius: 11px; |
| | | background-color: #fff; |
| | | } |
| | | |