Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8047de3

Browse files
committed
add category attribute in module data
1 parent855aba4 commit8047de3

File tree

2 files changed

+347
-293
lines changed

2 files changed

+347
-293
lines changed

‎scripts/build-doc.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ var fs = require('fs');
55
varisWin=/^win/.test(process.platform);
66
varSLASH=isWin ?'\\' :'/';
77

8-
functionparseComponentFile(fileString){
8+
functionparseComponentFile(filePath,fileString){
99
varblocks=parseCommentBlocks(fileString);
1010
varlines=[];
11+
vararr=filePath.split(SLASH);
1112
varmodule={
1213
name:'',
14+
category:arr[arr.length-2],// forms, buttons, etc
1315
author:'',
1416
description:'',
1517
props:[],
@@ -162,7 +164,7 @@ function scan(root, callback) {
162164
fse.walk(root)
163165
.on('data',function(item){
164166
// skip directory
165-
if(!item.stats.isDirectory()){
167+
if(!item.stats.isDirectory()&&item.path.endsWith('.vue')){
166168
items.push(item.path);
167169
console.log('scanning file '+item.path,items.length);
168170
}
@@ -181,7 +183,7 @@ function scan(root, callback) {
181183
}else{
182184
console.log('parsing component file',filePath);
183185

184-
result=parseComponentFile(data);
186+
result=parseComponentFile(filePath,data);
185187
result.name&&results.push(result);// store only when there is module name
186188

187189
// when loop end, output json file

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp