|
[多端开发]
switch 存在不能点击的问题
[复制链接]
本帖最后由 忽上忽下 于 2021-8-30 15:28 编辑
在 swith 标签的外层,包一层 view, 然后 view 使用绝对定位后, switch 就不能切换了,如果没有那层 view 则是可以正确切换
手机vivo x9i 安卓 7.1.2
代码如下:
- <template name='main'>
- <view class="">
- <safe-area></safe-area>
- <view class="testcc">
- <switch :checked="true" :disabled="false" color="#f00" @change="test" />
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'main',
- apiready() {
- },
- data() {
- return {
- }
- },
- methods: {
- test(e){
- console.log(`${JSON.stringify(e)}=========来自=======>页面:${api.winName}; 行数: [ ];`)
- }
- }
- }
- </script>
- <style>
- .testcc{
- position: absolute;
- top: 50px;
- left: 50px;
- }
- .height-8 {
- height: 8px;
- }
- .bg-000 {
- width: 100%;
- background: #000;
- }
- .width-100p {
- width: 100%;
- }
- .height-100p {
- height: 100%;
- }
- .width-300 {
- width: 300px;
- }
- .height-300 {
- height: 300px;
- }
- .width-50 {
- width: 50px;
- }
- .height-50 {
- height: 50px;
- }
- </style>
复制代码
|
|