Closed Iamdog closed 4 months ago
Selector 选择器组件
2.9.36
模拟器
2.35.2
希望可以正常单选
点击选择
[APPX][Page] pages/backcardtransact/backcardtransact/1 CallMethod error Cannot create property 'stopPropagation' on string '0'/TypeError: Cannot create property 'stopPropagation' on string '0' at wrapper$1 (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:14629:29) at Object.handleEvent [as __e] (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:14798:15) at e.invokeMethod (https://appx/af-appx.worker.min.js:6:669410) at e.invokeTargetMethodWithArgs (https://appx/af-appx.worker.min.js:6:856758) at e.callEvent (https://appx/af-appx.worker.min.js:6:198844) at Object.uA [as V] (https://appx/af-appx.worker.min.js:6:1068244) at Object.k__0 [as onChange] (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:39970:14) at triggerEventValues (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:3512:35) at Object.onChange (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:43166:48) at e.invoke (https://appx/af-appx.worker.min.js:6:743714) 1720604223010
uni-app 脚手架方式项目
<ant-selector :options="cardTypeOptions" minSelectedCount="1" :value="appealData.itself" @change="handleSelectorChange" />
appealData: { itself: '1' } handleSelectorChange(value, items, e) { console.log('handleSelectorChange', value, items, e) this.appealData.itself = value },
依赖库
"dependencies": { "@dcloudio/uni-app": "^2.0.2-3071120230427001", "@dcloudio/uni-app-plus": "2.0.2-3071120230427001", "@dcloudio/uni-h5": "2.0.2-3071120230427001", "@dcloudio/uni-i18n": "2.0.2-3071120230427001", "@dcloudio/uni-mp-360": "2.0.2-3071120230427001", "@dcloudio/uni-mp-alipay": "2.0.2-3071120230427001", "@dcloudio/uni-mp-baidu": "2.0.2-3071120230427001", "@dcloudio/uni-mp-jd": "^2.0.2-3071120230427001", "@dcloudio/uni-mp-kuaishou": "2.0.2-3071120230427001", "@dcloudio/uni-mp-lark": "^2.0.2-3071120230427001", "@dcloudio/uni-mp-qq": "2.0.2-3071120230427001", "@dcloudio/uni-mp-toutiao": "2.0.2-3071120230427001", "@dcloudio/uni-mp-vue": "2.0.2-3071120230427001", "@dcloudio/uni-mp-weixin": "2.0.2-3071120230427001", "@dcloudio/uni-mp-xhs": "^2.0.2-3071120230427001", "@dcloudio/uni-quickapp-native": "2.0.2-3071120230427001", "@dcloudio/uni-quickapp-webview": "2.0.2-3071120230427001", "@dcloudio/uni-stacktracey": "^2.0.2-3071120230427001", "@dcloudio/uni-stat": "2.0.2-3071120230427001", "@vue/shared": "3.4.27", "core-js": "^3.8.3", "flyio": "0.6.14", "sass": "^1.69.3", "sass-loader": "^13.3.2", "vue": ">= 2.6.14 < 2.7", "vuex": "3.6.2", "image-tools": "^1.4.0" }, "devDependencies": { "@dcloudio/types": "^3.3.2", "@dcloudio/uni-automator": "2.0.2-3071120230427001", "@dcloudio/uni-cli-i18n": "^2.0.2-3071120230427001", "@dcloudio/uni-cli-shared": "2.0.2-3071120230427001", "@dcloudio/uni-helper-json": "*", "@dcloudio/uni-migration": "2.0.2-3071120230427001", "@dcloudio/uni-template-compiler": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-uni": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-3071120230427001", "@dcloudio/webpack-uni-mp-loader": "2.0.2-3071120230427001", "@dcloudio/webpack-uni-pages-loader": "2.0.2-3071120230427001", "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-service": "~5.0.0", "babel-plugin-import": "1.13.8", "cross-env": "7.0.3", "jest": "25.5.4", "postcss-comment": "^2.0.0", "vue-template-compiler": ">= 2.6.14 < 2.7" },
cardTypeOptions: [ { text: '自治区内卡', value: '1' }, { text: '外省卡', value: '0' } ],
报错是stopPropagation,看上去跟你用的这个组件没关系吧
套了一层view貌似可以了。
还是不行,重新打包启动不行,修改一个属性热加载就可以。
组件
Selector 选择器组件
基础库版本
2.9.36
设备机型
模拟器
手机系统
模拟器
APP
组件库版本
2.35.2
预期行为
希望可以正常单选
报错日志
点击选择
[APPX][Page] pages/backcardtransact/backcardtransact/1 CallMethod error Cannot create property 'stopPropagation' on string '0'/TypeError: Cannot create property 'stopPropagation' on string '0' at wrapper$1 (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:14629:29) at Object.handleEvent [as __e] (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:14798:15) at e.invokeMethod (https://appx/af-appx.worker.min.js:6:669410) at e.invokeTargetMethodWithArgs (https://appx/af-appx.worker.min.js:6:856758) at e.callEvent (https://appx/af-appx.worker.min.js:6:198844) at Object.uA [as V] (https://appx/af-appx.worker.min.js:6:1068244) at Object.k__0 [as onChange] (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:39970:14) at triggerEventValues (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:3512:35) at Object.onChange (http://127.0.0.1:57224/index.worker.js?hash=4948a64c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A57224%2Findex.html&page=pages%2Findex%2Findex&appId=2021003165643107&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:43166:48) at e.invoke (https://appx/af-appx.worker.min.js:6:743714) 1720604223010
复现步骤
uni-app 脚手架方式项目
<ant-selector :options="cardTypeOptions" minSelectedCount="1" :value="appealData.itself" @change="handleSelectorChange" />
依赖库
"dependencies": { "@dcloudio/uni-app": "^2.0.2-3071120230427001", "@dcloudio/uni-app-plus": "2.0.2-3071120230427001", "@dcloudio/uni-h5": "2.0.2-3071120230427001", "@dcloudio/uni-i18n": "2.0.2-3071120230427001", "@dcloudio/uni-mp-360": "2.0.2-3071120230427001", "@dcloudio/uni-mp-alipay": "2.0.2-3071120230427001", "@dcloudio/uni-mp-baidu": "2.0.2-3071120230427001", "@dcloudio/uni-mp-jd": "^2.0.2-3071120230427001", "@dcloudio/uni-mp-kuaishou": "2.0.2-3071120230427001", "@dcloudio/uni-mp-lark": "^2.0.2-3071120230427001", "@dcloudio/uni-mp-qq": "2.0.2-3071120230427001", "@dcloudio/uni-mp-toutiao": "2.0.2-3071120230427001", "@dcloudio/uni-mp-vue": "2.0.2-3071120230427001", "@dcloudio/uni-mp-weixin": "2.0.2-3071120230427001", "@dcloudio/uni-mp-xhs": "^2.0.2-3071120230427001", "@dcloudio/uni-quickapp-native": "2.0.2-3071120230427001", "@dcloudio/uni-quickapp-webview": "2.0.2-3071120230427001", "@dcloudio/uni-stacktracey": "^2.0.2-3071120230427001", "@dcloudio/uni-stat": "2.0.2-3071120230427001", "@vue/shared": "3.4.27", "core-js": "^3.8.3", "flyio": "0.6.14", "sass": "^1.69.3", "sass-loader": "^13.3.2", "vue": ">= 2.6.14 < 2.7", "vuex": "3.6.2", "image-tools": "^1.4.0" }, "devDependencies": { "@dcloudio/types": "^3.3.2", "@dcloudio/uni-automator": "2.0.2-3071120230427001", "@dcloudio/uni-cli-i18n": "^2.0.2-3071120230427001", "@dcloudio/uni-cli-shared": "2.0.2-3071120230427001", "@dcloudio/uni-helper-json": "*", "@dcloudio/uni-migration": "2.0.2-3071120230427001", "@dcloudio/uni-template-compiler": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-uni": "2.0.2-3071120230427001", "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-3071120230427001", "@dcloudio/webpack-uni-mp-loader": "2.0.2-3071120230427001", "@dcloudio/webpack-uni-pages-loader": "2.0.2-3071120230427001", "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-service": "~5.0.0", "babel-plugin-import": "1.13.8", "cross-env": "7.0.3", "jest": "25.5.4", "postcss-comment": "^2.0.0", "vue-template-compiler": ">= 2.6.14 < 2.7" },
复现 demo