1
1
priority 100
2
2
3
- snippet c " const" b
3
+ snippet "c(onst)?" " const" br
4
4
const ${1} = ${2: '1ドル ' } ;
5
5
endsnippet
6
6
7
- snippet l " let" b
7
+ snippet "l(et)?" " let" br
8
8
let ${1} = ${2: '1ドル ' } ;
9
9
endsnippet
10
10
11
11
snippet "i(mport|mp|m)?" " import" br
12
12
import ${1} from '${2: ./ }${3: 1ドル } ';
13
13
endsnippet
14
14
15
- snippet e " export" b
16
- export ${1: default }
15
+ snippet "e(xport|xp|x)?" " export" br
16
+ export ${1: default } ;
17
17
endsnippet
18
18
19
19
snippet ie " Import file then export" b
@@ -31,9 +31,9 @@ ${1:key}: ${0:value},
31
31
endsnippet
32
32
33
33
snippet :f " method: func(...) { ... }"
34
- ${1: method_name } : function ( ${2: args } ) {
35
- return ${3 } ;
36
- }
34
+ ${1: key } : ${2: ( args) } => {
35
+ return ${4 } ;
36
+ }${3 : ; }
37
37
endsnippet
38
38
39
39
snippet "\.(map|filter|forEach|reduce)" " Array method with an arrow function" r
@@ -56,15 +56,23 @@ snippet =>> "Inline"
56
56
(${1: args } ) => (${3} );
57
57
endsnippet
58
58
59
+ snippet expf " Export function" b
60
+ export ${1: default } function(2ドル ) {
61
+ 3ドル
62
+ };
63
+ endsnippet
64
+
59
65
60
66
# React & JSX
61
67
snippet rrcc " React Redux Class Component" b
62
68
import React, { Component, PropTypes } from 'react';
63
69
import { connect } from 'react-redux';
64
- import styles from './${1 : `!v expand('%:t:r')` } .css';
70
+ import styles from './${2 : 1ドル } .css';
65
71
66
- class $1 extends Component {
72
+ class ${1 : `!v expand('%:t:r')` } extends Component {
67
73
static propTypes = {
74
+ children: PropTypes.node,
75
+ className: PropTypes.string,
68
76
dispatch: PropTypes.func.isRequired,
69
77
};
70
78
@@ -75,7 +83,7 @@ class 1ドル extends Component {
75
83
render() {
76
84
return (
77
85
<div className={styles.base}>
78
- ${2 }
86
+ ${3 }
79
87
</div>
80
88
);
81
89
}
@@ -90,10 +98,12 @@ endsnippet
90
98
91
99
snippet rcc " React Class Component" b
92
100
import React, { Component, PropTypes } from 'react';
93
- import styles from './${1 : `!v expand('%:t:r')` } .css';
101
+ import styles from './${2 : 1ドル } .css';
94
102
95
- class $1 extends Component {
103
+ class ${1 : `!v expand('%:t:r')` } extends Component {
96
104
static propTypes = {
105
+ children: PropTypes.node,
106
+ className: PropTypes.string,
97
107
};
98
108
99
109
constructor(props) {
@@ -103,7 +113,7 @@ class 1ドル extends Component {
103
113
render() {
104
114
return (
105
115
<div className={styles.base}>
106
- ${2 }
116
+ ${3 }
107
117
</div>
108
118
);
109
119
}
@@ -112,13 +122,13 @@ class 1ドル extends Component {
112
122
export default 1ドル ;
113
123
endsnippet
114
124
115
- snippet rsc " React Stateless Component" b
125
+ snippet rfc " React Functional Component" b
116
126
import React, { PropTypes } from 'react';
117
- import styles from './${1 : `!v expand('%:t:r')` } .css';
127
+ import styles from './${2 : 1ドル } .css';
118
128
119
- const $1 = ({ ${2 : ...props } }) => (
129
+ const ${1 : `!v expand('%:t:r')` } = ({ ${3 : ...props } }) => (
120
130
<div className={styles.base}>
121
- $3
131
+ $4
122
132
</div>
123
133
);
124
134
@@ -131,11 +141,20 @@ 1ドル.propTypes = {
131
141
export default 1ドル ;
132
142
endsnippet
133
143
144
+
145
+
134
146
snippet cn " className"
135
147
className="${1} "
136
148
endsnippet
137
149
138
-
150
+ snippet class " Class" b
151
+ class ${1: Name } {
152
+ constructor(${2: arg } ) {
153
+ ${3}
154
+ }
155
+ ${4}
156
+ }
157
+ endsnippet
139
158
140
159
snippet cl " console.log(...)" b
141
160
console.log('${2: 1ドル : } ', ${1} );
0 commit comments