vux
vux copied to clipboard
actionsheet 组件的问题
<actionsheet v-model="showOutstockMenu" :menus="outMenu" @on-click-menu="outChoiceOperation" show-cancel> 默认状态 showOutstockMenu: false, outMenu: [ { "label": "邮寄", "value": 1 }, { "label": "自取","value": 2 } ], vux 版本:2.9.0 问题描述:
- 页面会默认显示 actionsheet 的内容,(没有隐藏,和官网 demo 一样,会自动添加到页面到底部,页面往下拉就能看到)
- 在外层嵌套 div ,v-show:"showOutstockMenu",内容会隐藏,点击“取消”后,出现的遮罩层会隐藏,但是控制台报错—— Error in render: "TypeError: Cannot read property 'label' of undefined"; 内容会添加到底部,showOutstockMenu 的值依然为 true
问题的解决方式: 外层嵌套 div,同时 v-show 的设置和 actionsheet 的 v-model 的值(showContent)一致,在点击菜单的事件中,添加对 key = 'cancel' 的处理:将 showContent 设为 false; 虽然问题能解决,但是如果这个组件的实际效果不符合作者的预期效果,还是希望能够修改