Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【bug】滑动选择器 slider 的 disable 状态显示有问题 #13

Open
pigbayspy opened this issue Mar 8, 2022 · 0 comments
Open

Comments

@pigbayspy
Copy link

pigbayspy commented Mar 8, 2022

使用的方法如下:

<template>
<import name="apex-switch" src="apex-ui/components/switch/index"></import>
<apex-slider style-object="{{ {'color':'rgba(0,0,0,0.1)','selected-color':'#256fff','block-color':'#ffffff'} }}"
          onchange="onWindChange" disabled="{{disableWindControl}}"
         default-value="1" max="2" value-type="none" showTips="false" >
</template>
<script>

const autoMode = 2;

export default {
  data: {
    mode: 0,
    powered: true,
  },
  computed: {
    disableWindControl: {
      get() {
        return !(this.powered && this.mode !== autoMode);
      }
    }
  },
  onWindChange() {
    //...
  }
}
</script>

问题描述:

  • 组件初次渲染,disableWindControl 方法返回 false,slider 是可用状态,显示正常,可以滑动
  • 组件改变状态,disableWindControl 方法返回 true,slider 是不可用状态,组件变成灰色,显示正常,不可以滑动
  • 组件改变状态,disableWindControl 方法返回 false,slider 是可用状态,可以滑动,但仍然显示灰色,通过调试台可以看到仍然有一个 opacity: 0.3 的属性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant