cf-wx-app/src/pages/index/index.js
2018-12-11 17:34:06 +08:00

56 lines
979 B
JavaScript

import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { add, minus, asyncAdd } from '../../actions/counter'
import './index.scss'
@connect(({ counter }) => ({
counter
}), (dispatch) => ({
add () {
dispatch(add())
},
dec () {
dispatch(minus())
},
asyncAdd () {
dispatch(asyncAdd())
}
}))
class Index extends Component {
config = {
navigationBarTitleText: '首页'
}
//http://ihome6.com/Shop-supplyShops
componentDidMount(){
Taro.navigateTo({
// url: '/pages/home/home'
// url: '/pages/goodsPublish/goodsPublish'
url: '/pages/home/home'
})
}
componentWillReceiveProps (nextProps) {
console.log(this.props, nextProps)
}
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
render () {
return (
<View className='index'>
</View>
)
}
}
export default Index