.wrap{ word-break: break-all; word-wrap:break-word; white-space:pre-line; }
// taro 爲例 import Taro, { Component, Config } from '@tarojs/taro'; export default class HomePage extends Component { config: Config = { navigationBarTitleText: '首頁', disableScroll: true, // 這一句 }; }
container.jscss
import Child from 'child'; render(){ return <View> <Child onToggle={this.handleToggle.bind(this)}/> </View> }
child.jsgit
handleClick(){ this.props.onToggle(); } render(){ return <View onClick={this.handleClick.bind(this)}>點擊測試</View> }
state = { scale : 10 } resetScale(){ this.setState({ scale:this.state.scale===10?10.00001:10 }) } render(){ return ( <Map scale={this.state.scale}/> ) }
Taro.getLocation({ type:'gcj02' // 這裏 }) .then(res=>{ let { longitude, latitude } = res; })