@jd_5257de320dc47 因为只做了小程序的没有做h5的,可能是存在兼容问题
I
iNiL0119 发布的帖子
-
RE: React Taro多行文本省略无效
<View className='lines'>React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效,React Taro多行文本省略无效。</View>
.lines { overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
这不就可以了吗
-
Hooks报错TypeError: Object(...) is not a function
import Taro, { useState } from '@tarojs/taro' setHooksTest = () => { const [style, setStyle] = useState({ background:'red', color:'blue' }) return <View style={{background: style.background, color: style.color}} onClick={()=>{setStyle({background:'green', color:'#ccc'})}} > 测试 </View> }
render之后一直报错TypeError: Object(...) is not a function
TypeError: Object(...) is not a function at Goods.setHooksTest (index.jsx:160) at Goods.render (index.jsx:58) at ye (react-reconciler.production.min.js:90) at xe (react-reconciler.production.min.js:89) at ig (react-reconciler.production.min.js:162) at hg (react-reconciler.production.min.js:139) at bg (react-reconciler.production.min.js:138) at Of (react-reconciler.production.min.js:132) at react-reconciler.production.min.js:30 at push../node_modules/scheduler/cjs/scheduler.production.min.js.exports.unstable_runWithPriority (scheduler.production.min.js:18)
有谁知道是什么原因吗?