| | |
| | | */ |
| | | export default { |
| | | name: 'u-swipe-action-item', |
| | | emits: ['click'], |
| | | |
| | | emits: ['click', 'update:show'], |
| | | mixins: [ |
| | | mpMixin, |
| | | mixin, |
| | |
| | | // #ifdef APP-NVUE |
| | | nvue, |
| | | // #endif |
| | | // #ifdef APP-VUE || MP-WEIXIN || H5 || MP-QQ || H5 |
| | | // #ifdef APP-VUE || MP-WEIXIN || MP-QQ || H5 |
| | | wxs, |
| | | // #endif |
| | | // #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO |
| | |
| | | autoClose: true, |
| | | }, |
| | | // 当前状态,open-打开,close-关闭 |
| | | status: 'close', |
| | | status: '', |
| | | sliderStyle: {} |
| | | } |
| | | }, |
| | |
| | | // #ifndef APP-NVUE |
| | | wxsInit(newValue, oldValue) { |
| | | this.queryRect() |
| | | } |
| | | }, |
| | | // #endif |
| | | status(newValue) { |
| | | if (newValue === 'open') { |
| | | this.$emit('update:show', true) |
| | | this.parent && this.parent.setOpendItem(this) |
| | | } else { |
| | | this.$emit('update:show', false) |
| | | } |
| | | }, |
| | | show(newValue) { |
| | | if (newValue) { |
| | | this.status = 'open' |
| | | } else { |
| | | this.status = 'close' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | wxsInit() { |
| | |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | }, |
| | | beforeUmount() { |
| | | this.closeHandler() |
| | | }, |
| | | methods: { |
| | | addUnit, |
| | |
| | | // #endif |
| | | // 按钮被点击 |
| | | buttonClickHandler(item, index) { |
| | | this.$emit('click', { |
| | | let ret = this.$emit('click', { |
| | | index, |
| | | name: this.name |
| | | }, () => { |
| | | }) |
| | | if (this.closeOnClick) { |
| | | this.closeHandler() |
| | | } |
| | | } |
| | | }, |
| | | } |