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

小程序 Input 上的 boolean 类型的属性设置为 false 时无效 [Vue >= 3.4.28] #15946

Closed
eiinu opened this issue Jun 20, 2024 · 2 comments
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@eiinu
Copy link
Contributor

eiinu commented Jun 20, 2024

相关平台

微信小程序

复现仓库

https://github.com/eiinu/taro-input-boolean.git
小程序基础库: 3.4.7
使用框架: Vue 3

复现步骤

<template>
  <view class="index">
    <input placeholder="可正常输入"/>
    <input :disabled="false" placeholder="被禁用"/>
    <input :disabled="true" placeholder="被禁用"/>
  </view>
</template>

pnpm i
pnpm dev:weapp

期望结果

设置了 disabled 为 false 的组件可以正常输入

实际结果

设置了 disabled 为 false 的组件被禁用了

环境信息

👽 Taro v3.6.32


  Taro CLI 3.6.32 environment info:
    System:
      OS: macOS 12.4
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
      npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.32 => 3.6.32 
      @tarojs/components: 3.6.32 => 3.6.32 
      @tarojs/helper: 3.6.32 => 3.6.32 
      @tarojs/plugin-framework-vue3: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-alipay: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-h5: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-jd: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-qq: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-swan: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-tt: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-weapp: 3.6.32 => 3.6.32 
      @tarojs/runtime: 3.6.32 => 3.6.32 
      @tarojs/shared: 3.6.32 => 3.6.32 
      @tarojs/taro: 3.6.32 => 3.6.32 
      @tarojs/taro-loader: 3.6.32 => 3.6.32 
      @tarojs/webpack5-runner: 3.6.32 => 3.6.32 
      babel-preset-taro: 3.6.32 => 3.6.32 
      eslint-config-taro: 3.6.32 => 3.6.32 

补充信息

1、Vue 版本

在 Vue 版本 >= 3.4.28 时会出现此 issue 反馈的问题,< 3.4.28 时是正常的。

2、平台

小程序下存在问题,H5 环境正常。

3、涉及范围:小程序原生组件上的 boolean 类型的属性
比如:

  • input 上的 disabled、readonly 等
  • textarea 上的 disabled 等
@eiinu eiinu changed the title 小程序 Input 上的 boolean 类型的属性设置为 false 时无效 小程序 Input 上的 boolean 类型的属性设置为 false 时无效 [Vue >= 3.4.28] Jun 20, 2024
@TheKonka TheKonka added V-3 Version - 3.x F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 labels Jun 21, 2024
@Logosww
Copy link

Logosww commented Jun 21, 2024

这里有nutui关于这个问题导致的原生组件boolean属性值绑定的临时解决办法 #jdf2e/nutui#3104 ,不过这个方法对于默认值为true的属性值想要显式指定为false的情况好像不行,比如scroll-view的show-scrollbar属性,还是得taro来彻底解决这个issue。

@eiinu
Copy link
Contributor Author

eiinu commented Jun 22, 2024

Vue 3.4.30 已修复该问题 https://github.com/vuejs/core/releases/tag/v3.4.30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants