相关平台
微信小程序
小程序基础库: 2.21.0
使用框架: React
复现步骤
import { AtInput } from "taro-ui";
import { useState } from "react";
import { View, Image } from "@tarojs/components";
const Demo = () => {
const [state, setState] = useState(0);
const handleChange = (value) => {
setState(value);
};
return (<>
<View>
<AtInput
clear
title="验证码"
type="text"
maxlength={state}
placeholder="验证码"
value={state}
onChange={value => handleChange(value)}
>
<Image src="www.xxx.com" />
</AtInput>
</View>
</>);
};
export default Demo;
期望结果
maxLength 限制输入长度
实际结果
限制没效果
环境信息
? Taro v3.3.15
Taro CLI 3.3.15 environment info:
System:
OS: macOS 12.0.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.4 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 3.2.16 => 3.2.16
@tarojs/mini-runner: 3.2.16 => 3.2.16
@tarojs/react: 3.2.16 => 3.2.16
@tarojs/runtime: 3.2.16 => 3.2.16
@tarojs/taro: 3.2.16 => 3.2.16
@tarojs/webpack-runner: 3.2.16 => 3.2.16
babel-preset-taro: 3.2.16 => 3.2.16
eslint-config-taro: 3.2.16 => 3.2.16
react: ^17.0.0 => 17.0.2
taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10
补充信息
input maxLength 可以限制住
1条答案
按热度按时间twh00eeo1#
https://github.com/NervJS/taro-ui
这个东西 都不更新了 = =