- coverview 中的强制换行
.wrap{
word-break: break-all;
word-wrap:break-word;
white-space:pre-line;
}
- IOS 阻止页面弹性橡皮筋效果
// taro 为例
import Taro, { Component, Config } from '@tarojs/taro';
export default class HomePage extends Component {
config: Config = {
navigationBarTitleText: '首页',
disableScroll: true, // 这一句
};
}
- 组件之间的通信方法传递,taro 中需要方法名为 on 开头
container.js
import Child from 'child';
render(){
return <View>
<Child onToggle={this.handleToggle.bind(this)}/>
</View>
}
child.js
handleClick(){
this.props.onToggle();
}
render(){
return <View onClick={this.handleClick.bind(this)}>点击测试</View>
}
发表回复