nutui icon indicating copy to clipboard operation
nutui copied to clipboard

[bug]小程序input不支持动态修改type属性

Open haohan88615 opened this issue 2 years ago • 1 comments

@tarojs/taro

小程序input组件不支持动态修改type属性

password和text切换没有用

h5可以

haohan88615 avatar Aug 04 '22 09:08 haohan88615

你好 @haohan88615 , 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

ailululu avatar Sep 07 '22 09:09 ailululu

@tarojs/芋头

小程序input组件不支持动态修改type属性

password和text切换没有用

h5可以

在微信小程序下,input 的 type 是无法动态赋值的,可以用v-if来动态切换input。 代码示例:

<template v-if=state.isShow>
    <nut-input type="text" placeholder="文本" v-model="state.val1" label="文本" />
</template>
<template v-else>
    <nut-input type="password" placeholder="文本" v-model="state.val1" label="文本" />
</template>

ailululu avatar Oct 27 '22 02:10 ailululu