File tree 4 files changed +47
-3
lines changed 4 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jsdoc-vue-component" ,
3
- "version" : " 2.1.3 " ,
3
+ "version" : " 2.1.4 " ,
4
4
"description" : " A simple plugin for jsdoc (`pase vue SFC info to description`)" ,
5
5
"main" : " index.js" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change @@ -192,7 +192,11 @@ function parseEvents(ast) {
192
192
if ( skips . indexOf ( node . type ) != - 1 ) return estraverse . VisitorOption . Skip ;
193
193
194
194
if ( node . type == 'CallExpression' ) {
195
- if ( node . callee . property . name == '$emit' ) {
195
+ if (
196
+ node . callee
197
+ && node . callee . property
198
+ && node . callee . property . name == '$emit'
199
+ ) {
196
200
emitList . push ( node ) ;
197
201
}
198
202
}
Original file line number Diff line number Diff line change
1
+ import api from '../lib/api';
2
+ import {getUrl} from '../lib/site';
3
+
4
+ /**
5
+ * @vue
6
+ * @exports component/login
7
+ */
8
+ export default {
9
+ name: 'Login',
10
+ data: () => {
11
+ return {
12
+ username: '',
13
+ password: '',
14
+ };
15
+ },
16
+ methods: {
17
+ submit() {
18
+ if (!this.username.trim() || !this.password.trim()) {
19
+ alert('请填写用户名密码!');
20
+ return;
21
+ }
22
+
23
+ api.postForm('api/auth/login', {
24
+ username: this.username.trim(),
25
+ password: this.password.trim()
26
+ }).then(data => {
27
+ alert ('登录成功');
28
+ location.href = getUrl('/app/');
29
+ }).catch(error => {
30
+ alert(error.message);
31
+ });
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -3,5 +3,11 @@ const path = require('path');
3
3
const parse = require ( '../parse' ) ;
4
4
5
5
const code = fs . readFileSync ( path . join ( __dirname , './component/test.vue' ) ) ;
6
-
6
+ console . log ( '=========begin code=======' )
7
7
console . log ( parse ( code ) ) ;
8
+ console . log ( '=========end code=======' )
9
+
10
+ const code2 = fs . readFileSync ( path . join ( __dirname , './component/login.vue' ) ) ;
11
+ console . log ( '=========begin code2=======' )
12
+ console . log ( parse ( code2 ) ) ;
13
+ console . log ( '=========end code2=======' )
You can’t perform that action at this time.
0 commit comments