b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

AtSwipeAction 出现相同的id swipeAction-2020 #94

Closed allen-wiki closed 3 years ago

allen-wiki commented 3 years ago

问题描述

循环 组件 AtSwipeAction

导致多个数据 滑动 只能滑动一个

版本信息

taro-ui-vue3@1.0.0-alpha.18

涉及的平台

weapp

错误信息

微信开发者工具报警告 For developer:Do not set same key "swipeAction-2020" in wx:key

// error message here

代码

// code here

function isTest() {
    return process.env.NODE_ENV === 'test';
}

      const state = reactive({
            componentId: isTest() ? '2020' : uuid(),
            offsetSize: 0,
            _isOpened: !!props.isOpened
        });
当用户的NODE_ENV 也为test 时  isTest 成立  导致 componentId 为2020
allen-wiki commented 3 years ago

应该事打包的时候 使用test 打包造成的

b2nil commented 3 years ago

这是为了方便测试写的,下个版本想办法在打包的时候,把测试用的代码删除掉。