Commit f7c8bfe1 by lirandong

添加 taro-native-shell

parent e8435962
/taro-native-shell
\ No newline at end of file
......@@ -12,4 +12,4 @@
"useJSXTextNode": true,
"project": "./tsconfig.json"
}
}
}
{
"editor.formatOnSave": true,
"prettier.stylelintIntegration": true,
"prettier.tabWidth": 2,
"prettier.singleQuote": true,
"typescript.tsdk": "node_modules/typescript/lib",
"prettier.printWidth": 120,
"prettier.semi": false
}
{
"name": "Vmatrix-client-taro",
"name": "vmatrix-client-taro",
"version": "1.0.0",
"private": true,
"description": "",
......@@ -36,35 +36,35 @@
"@tarojs/taro-swan": "1.3.12",
"@tarojs/taro-tt": "1.3.12",
"@tarojs/taro-weapp": "1.3.12",
"nervjs": "^1.4.0",
"nerv-devtools": "^1.4.0",
"nervjs": "^1.4.0",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@types/react": "^16.4.8",
"@types/webpack-env": "^1.13.6",
"@tarojs/plugin-babel": "1.3.12",
"@tarojs/plugin-csso": "1.3.12",
"@tarojs/plugin-less": "1.3.12",
"@tarojs/plugin-uglifyjs": "1.3.12",
"@tarojs/webpack-runner": "1.3.12",
"@types/react": "^16.4.8",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/parser": "^1.6.0",
"babel-eslint": "^8.2.3",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^8.2.3",
"eslint": "^5.16.0",
"eslint-config-taro": "1.3.12",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-taro": "1.3.12",
"stylelint": "9.3.0",
"stylelint-config-taro-rn": "1.3.12",
"stylelint-taro-rn": "1.3.12",
"eslint-plugin-taro": "1.3.12",
"@typescript-eslint/parser": "^1.6.0",
"typescript": "^3.0.1"
}
}
......@@ -36,24 +36,26 @@ type PageState = {}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface Index {
props: IProps;
props: IProps
}
@connect(({ counter }) => ({
@connect(
({ counter }) => ({
counter
}), (dispatch) => ({
add () {
}),
dispatch => ({
add() {
dispatch(add())
},
dec () {
dec() {
dispatch(minus())
},
asyncAdd () {
asyncAdd() {
dispatch(asyncAdd())
}
}))
})
)
class Index extends Component {
/**
* 指定config的类型声明为: Taro.Config
*
......@@ -65,24 +67,34 @@ class Index extends Component {
navigationBarTitleText: '首页'
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
console.log(this.props, nextProps)
}
componentWillUnmount () { }
componentWillUnmount() {}
componentDidShow () { }
componentDidShow() {}
componentDidHide () { }
componentDidHide() {}
render () {
render() {
return (
<View className='index'>
<Button className='add_btn' onClick={this.props.add}>+</Button>
<Button className='dec_btn' onClick={this.props.dec}>-</Button>
<Button className='dec_btn' onClick={this.props.asyncAdd}>async</Button>
<View><Text>{this.props.counter.num}</Text></View>
<View><Text>Hello, World</Text></View>
<View className="index">
<Button className="add_btn" onClick={this.props.add}>
+
</Button>
<Button className="dec_btn" onClick={this.props.dec}>
-
</Button>
<Button className="dec_btn" onClick={this.props.asyncAdd}>
async
</Button>
<View>
<Text>{this.props.counter.num}</Text>
</View>
<View>
<Text>Hello, World</Text>
</View>
</View>
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment