ソースを参照

update config.json

lifeifan 7 年 前
コミット
89c69a5d38

+ 6 - 1
build/webpack.demo.build.conf.js

@@ -1,6 +1,8 @@
 const webpack = require('webpack');
 const baseConf = require('./webpack.demo.base.conf.js');
 const merge = require('webpack-merge');
+const path = require('path');
+const CopyWebpackPlugin = require('copy-webpack-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
 const rimraf = require('rimraf');
@@ -21,7 +23,10 @@ module.exports = merge(baseConf, {
             'process.env': {
                 NODE_ENV: '"production"'
             }
-        })
+        }),
+        new CopyWebpackPlugin([
+            { from: path.join(__dirname, "../sites/demo/asset/img/favicon.ico"), to: path.join(__dirname, "../dist/sites/")}
+        ]),
     ],
     optimization: {
         minimizer: [

+ 0 - 1
build/webpack.disperse.conf.js

@@ -1,5 +1,4 @@
 const webpack = require('webpack');
-const config = require('../package.json');
 const cptConf = require('../src/config.json');
 const webpackBaseConf = require('./webpack.base.conf.js');
 const path = require('path');

BIN
sites/demo/asset/img/favicon.ico


+ 9 - 17
sites/demo/view/index.vue

@@ -4,17 +4,17 @@
     <div class="version">NutUI 2.0</div>
     <p>NutUI 是一套轻量级移动端Vue组件库。</p>
     <div
-      :class="['demo-list-box',{'unfold':foldStatus[sortIdx]}]"
-      v-for="(sortName,sortIdx) in sorts"
-      :key="sortIdx"
+      :class="['demo-list-box',{'unfold':foldStatus[item]}]"
+      v-for="item in sorts"
+      :key="item"
     >
-      <h4 @click="toggleFold(sortIdx)">
-        {{sortName}}
+      <h4 @click="toggleFold(item)">
+        {{oriSorts[item]}}
         <i></i>
       </h4>
       <ul>
         <template v-for="cpt in packages">
-          <li v-if="cpt.showDemo !== false && cpt.sort == sortIdx" :key="cpt.name">
+          <li v-if="cpt.showDemo !== false && cpt.sort == item" :key="cpt.name">
             <a :href="'./demo.html#/'+cpt.name">
               {{cpt.name}}
               <span>{{cpt.chnName}}</span>
@@ -35,7 +35,8 @@ export default {
       path: "",
       packages: {},
       sortedPackages: [],
-      sorts: [],
+      oriSorts:[],
+      sorts: [1,2,0,3,4,5],
       foldStatus: [],
       version: ""
     };
@@ -49,16 +50,7 @@ export default {
   created() {
     this.packages = Conf.packages;
     this.version = Conf.version;
-    //this.sorts = Conf.sorts;
-
-    this.sorts = [
-      "数据录入",
-      "操作反馈",
-      "数据展示",
-      "导航组件",
-      "布局组件",
-      "基础组件"
-    ];
+    this.oriSorts = Conf.sorts;
     
     this.foldStatus = Array(this.sorts.length)
       .join(",")

+ 64 - 64
src/config.json

@@ -1,5 +1,5 @@
 {
-  "version": "0.0.1",
+  "version": "2.0.0",
   "sorts": [
     "数据展示",
     "数据录入",
@@ -10,26 +10,6 @@
   ],
   "packages": [
     {
-      "name": "Switch",
-      "version": "1.0.0",
-      "sort": "1",
-      "chnName": "开关",
-      "type": "component",
-      "showDemo": true,
-      "desc": "一种滑动开关,通过点击使按钮左右滑动,同时触发对应的开关状态",
-      "author": "Frans"
-    },
-    {
-      "name": "Radio",
-      "version": "1.0.0",
-      "sort": "1",
-      "chnName": "单选按钮",
-      "type": "component",
-      "showDemo": true,
-      "desc": "单选按钮,可组合成单选按钮组",
-      "author": "Frans"
-    },
-    {
       "name": "Cell",
       "version": "1.0.0",
       "sort": "4",
@@ -81,16 +61,6 @@
     },
     {
       "version": "1.0.0",
-      "name": "CheckBox",
-      "sort": "1",
-      "chnName": "复选按钮",
-      "desc": "复选多个选项",
-      "type": "component",
-      "showDemo": true,
-      "author": "Vicky.Ye"
-    },
-    {
-      "version": "1.0.0",
       "name": "Tab",
       "sort": "3",
       "chnName": "选项卡",
@@ -131,20 +101,20 @@
     },
     {
       "version": "1.0.0",
-      "name": "Price",
-      "sort": "0",
-      "chnName": "商品价格",
-      "desc": "商品价格组件,支持小数点前后应用不同样式、千位分隔、人民币符号等功能",
+      "name": "DatePicker",
+      "sort": "1",
+      "chnName": "日期选择",
+      "desc": "日期选择",
       "type": "component",
       "showDemo": true,
-      "author": "liaoyanli5"
+      "author": "iris"
     },
     {
       "version": "1.0.0",
-      "name": "DatePicker",
+      "name": "Calendar",
       "sort": "1",
-      "chnName": "日期选择",
-      "desc": "日期选择",
+      "chnName": "日",
+      "desc": "日",
       "type": "component",
       "showDemo": true,
       "author": "iris"
@@ -201,13 +171,13 @@
     },
     {
       "version": "1.0.0",
-      "name": "CheckBoxGroup",
-      "sort": "1",
-      "chnName": "复选按钮组",
-      "desc": "成组出现的复选按钮组件",
+      "name": "Price",
+      "sort": "0",
+      "chnName": "商品价格",
+      "desc": "商品价格组件,支持小数点前后应用不同样式、千位分隔、人民币符号等功能",
       "type": "component",
       "showDemo": true,
-      "author": "Vicky.Ye"
+      "author": "liaoyanli5"
     },
     {
       "version": "1.0.0",
@@ -271,16 +241,6 @@
     },
     {
       "version": "1.0.0",
-      "name": "Calendar",
-      "sort": "1",
-      "chnName": "日历",
-      "desc": "日历",
-      "type": "component",
-      "showDemo": true,
-      "author": "iris"
-    },
-    {
-      "version": "1.0.0",
       "name": "Rating",
       "sort": "1",
       "chnName": "评分",
@@ -301,16 +261,6 @@
     },
     {
       "version": "1.0.0",
-      "name": "ImagePicker",
-      "sort": "1",
-      "chnName": "图片选择器",
-      "desc": "图片选择器",
-      "type": "component",
-      "showDemo": true,
-      "author": "苏子刚"
-    },
-    {
-      "version": "1.0.0",
       "name": "Menu",
       "sort": "3",
       "chnName": "菜单",
@@ -350,6 +300,56 @@
       "author": "lemon"
     },
     {
+      "version": "1.0.0",
+      "name": "ImagePicker",
+      "sort": "1",
+      "chnName": "图片选择器",
+      "desc": "图片选择器",
+      "type": "component",
+      "showDemo": true,
+      "author": "苏子刚"
+    },
+    {
+      "name": "Switch",
+      "version": "1.0.0",
+      "sort": "1",
+      "chnName": "开关",
+      "type": "component",
+      "showDemo": true,
+      "desc": "一种滑动开关,通过点击使按钮左右滑动,同时触发对应的开关状态",
+      "author": "Frans"
+    },
+    {
+      "name": "Radio",
+      "version": "1.0.0",
+      "sort": "1",
+      "chnName": "单选按钮",
+      "type": "component",
+      "showDemo": true,
+      "desc": "单选按钮,可组合成单选按钮组",
+      "author": "Frans"
+    },
+    {
+      "version": "1.0.0",
+      "name": "CheckBox",
+      "sort": "1",
+      "chnName": "复选按钮",
+      "desc": "复选多个选项",
+      "type": "component",
+      "showDemo": true,
+      "author": "Vicky.Ye"
+    },
+    {
+      "version": "1.0.0",
+      "name": "CheckBoxGroup",
+      "sort": "1",
+      "chnName": "复选按钮组",
+      "desc": "成组出现的复选按钮组件",
+      "type": "component",
+      "showDemo": true,
+      "author": "Vicky.Ye"
+    },
+    {
       "version":"1.0.0",
       "name":"ShortPassword",
       "chnName":"短密码",