问题:tarojs3.x 和 taro-ui2.x 不兼容;
改成:tarojs3.x 和 taro-ui3.x 兼容;
"dependencies": {
"@tarojs/taro": "3.3.8",
},
"devDependencies": {
"taro-ui": "^3.0.0-alpha.3",
},
import ‘taro-ui/dist/style/index.scss‘
import { AtSearchBar } from ‘taro-ui‘
const Home = () => {
const [search, setSearch] = useState(‘‘)
const heandleSearch = (value) => {
console.log(‘value===‘, value)
}
return (
<AtSearchBar
value={search}
onChange={heandleSearch}
/>
);
};
export default Home;
原文:https://www.cnblogs.com/aivsok/p/15341822.html