Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f7c8bfe1
authored
Aug 06, 2019
by
lirandong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 taro-native-shell
parent
e8435962
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
28 deletions
+51
-28
.eslintignore
+2
-0
.eslintrc
+1
-1
.vscode/settings.json
+9
-0
package.json
+8
-8
src/pages/index/index.tsx
+31
-19
No files found.
.eslintignore
0 → 100644
View file @
f7c8bfe1
/taro-native-shell
\ No newline at end of file
.eslintrc
View file @
f7c8bfe1
...
...
@@ -12,4 +12,4 @@
"useJSXTextNode": true,
"project": "./tsconfig.json"
}
}
}
.vscode/settings.json
0 → 100644
View file @
f7c8bfe1
{
"editor.formatOnSave"
:
true
,
"prettier.stylelintIntegration"
:
true
,
"prettier.tabWidth"
:
2
,
"prettier.singleQuote"
:
true
,
"typescript.tsdk"
:
"node_modules/typescript/lib"
,
"prettier.printWidth"
:
120
,
"prettier.semi"
:
false
}
package.json
View file @
f7c8bfe1
{
"name"
:
"
V
matrix-client-taro
"
,
"name"
:
"
v
matrix-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"
}
}
src/pages/index/index.tsx
View file @
f7c8bfe1
...
...
@@ -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
>
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment