Skip to content

Commit

Permalink
fix(#4): all methods have the same reference
Browse files Browse the repository at this point in the history
  • Loading branch information
HcySunYang committed Oct 24, 2018
1 parent 18e3742 commit 325c486
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuese",
"version": "1.0.3",
"version": "1.0.4",
"main": "dist/vuese.js",
"bin": "bin/cli.js",
"types": "dist/index.d.ts",
Expand Down
11 changes: 5 additions & 6 deletions src/parser/parseJavascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ const mainTraveres = {

// Processing methods
if (isVueOption(path, 'methods')) {
const result: MethodResult = {
name: ''
}
const properties = path.node.value.properties
properties.forEach((node: any) => {
const commentsRes: CommentResult = getComments(node)
// Collect only methods that have @vuese annotations
if (commentsRes.vuese) {
result.name = node.key.name
result.describe = commentsRes.default
result.argumentsDesc = commentsRes.arg
const result: MethodResult = {
name: node.key.name,
describe: commentsRes.default,
argumentsDesc: commentsRes.arg
}
if (onMethod) onMethod(result)
}
})
Expand Down

0 comments on commit 325c486

Please sign in to comment.