-
zhangwei
2025-03-05 16213c0f85aa3ac8317797bf4a05fd12940e16d3
src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue
@@ -90,8 +90,7 @@
    */
   export default {
      name: 'u-swipe-action-item',
      emits: ['click'],
      emits: ['click', 'update:show'],
      mixins: [
         mpMixin,
         mixin,
@@ -101,7 +100,7 @@
         // #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
@@ -118,7 +117,7 @@
               autoClose: true,
            },
            // 当前状态,open-打开,close-关闭
            status: 'close',
            status: '',
            sliderStyle: {}
         }
      },
@@ -127,8 +126,23 @@
         // #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() {
@@ -137,6 +151,9 @@
      },
      mounted() {
         this.init()
      },
      beforeUmount() {
         this.closeHandler()
      },
      methods: {
         addUnit,
@@ -170,10 +187,14 @@
         // #endif
         // 按钮被点击
         buttonClickHandler(item, index) {
            this.$emit('click', {
            let ret = this.$emit('click', {
               index,
               name: this.name
            }, () => {
            })
            if (this.closeOnClick) {
               this.closeHandler()
            }
         }
      },
   }