import Taro, { useState, useEffect, pxTransform } from "@tarojs/taro";
import { Textarea, View } from "@tarojs/components";
import { IProps } from "../../../@types/textarea";
import ClFlex from "../../components/flex";
import ClText from "../../components/text";
import ClLayout from "../../components/layout";
import { classNames } from "../../lib";
import "./index.scss";
import { BG_COLOR_LIST } from "../../lib/model";
export default function ClTextarea(props: IProps) {
const {
value,
autoFocus,
focus,
placeholder,
maxLength,
disabled,
showConfirmBar,
showLengthTip,
bgColor,
shadow,
height,
overMaxForbidden,
onChange,
onFocus,
onBlur,
onConfirm,
onLineChange
} = props;
const [tempValue, setTempValue] = useState("");
const tip = (
);
useEffect(() => {
setTempValue(value || "");
}, [value]);
return (
);
}
ClTextarea.options = {
addGlobalClass: true
};
ClTextarea.defaultProps = {
value: "",
autoFocus: false,
focus: false,
placeholder: "",
maxLength: 0,
disabled: false,
showConfirmBar: false,
showLengthTip: false,
height: 0,
overMaxForbidden: false,
bgColor: "white",
shadow: false,
onChange: () => {},
onFocus: () => {},
onBlur: () => {},
onConfirm: () => {},
onLineChange: () => {}
} as IProps;