Browse Source

fix: 配置文件修改

suzigang 2 years ago
parent
commit
8bc2f1da36
2 changed files with 21 additions and 8 deletions
  1. 11 8
      jd/generate-nutui-taro-vue.cjs
  2. 10 0
      src/config.json

+ 11 - 8
jd/generate-nutui-taro-vue.cjs

@@ -8,15 +8,18 @@ let importScssStr = `\n`;
 const packages = [];
 config.nav.map((item) => {
   item.packages.forEach((element) => {
-    let { name,exclude } = element;
-    const filePath = path.join(`src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
-    importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${
-      fs.existsSync(filePath) ? '.taro' : ''
-    }.vue';\n`;
-    importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
-    if (exclude != true) {
-      packages.push(name);
+    let { name,exclude, taro } = element;
+    if(taro == true) {
+      const filePath = path.join(`src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
+      importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${
+        fs.existsSync(filePath) ? '.taro' : ''
+      }.vue';\n`;
+      importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
+      if (exclude != true) {
+        packages.push(name);
+      }
     }
+    
   });
 });
 let installFunction = `function install(app: any) {

+ 10 - 0
src/config.json

@@ -153,6 +153,7 @@
           "cName": "全局配置",
           "desc": "用于配置NutUI组件全局",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "richard1015",
@@ -222,6 +223,7 @@
           "type": "component",
           "desc": "当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在距离屏幕固定的距离处",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "author": "szg2008",
           "styleDeps": []
@@ -895,6 +897,7 @@
           "cName": "虚拟列表",
           "desc": "可在成千上万条数据渲染时只渲染用户最大可见条数,提升页面渲染性能",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "szg2008",
@@ -1032,6 +1035,7 @@
           "type": "methods",
           "cName": "图片预览",
           "desc": "图片预览",
+          "taro": true,
           "sort": 4,
           "show": true,
           "author": "zongyue3",
@@ -1166,6 +1170,7 @@
           "cName": "文本省略",
           "desc": "文本省略",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "yangxiaolu3",
@@ -1178,6 +1183,7 @@
           "cName": "水印",
           "desc": "页面上添加特定的文字或图案。适用于防止信息盗用。",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "liukun",
@@ -1190,6 +1196,7 @@
           "cName": "趋势箭头",
           "desc": "带有箭头指示的百分比数字,用以展示指标趋势",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "liukun",
@@ -1202,6 +1209,7 @@
           "cName": "引导",
           "desc": "漫游式引导组件",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "yangxiaolu",
@@ -1319,6 +1327,7 @@
           "cName": "虚拟电子卡",
           "desc": "虚拟电子卡选择",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "yangxiaolu",
@@ -1364,6 +1373,7 @@
           "cName": "商品评论",
           "desc": "商品评论",
           "show": true,
+          "taro": true,
           "tarodoc": false,
           "type": "component",
           "author": "yangxiaolu",