Browse Source

Merge branch 'next' of https://github.com/jdf2e/nutui into next

ailululu 5 years ago
parent
commit
f9f812de5f

+ 14 - 0
README.md

@@ -5,6 +5,20 @@ Vue3.0 一套移动端轻量级组件库
     
 ![NutUI](https://img11.360buyimg.com/uba/jfs/t1/11117/21/3608/18942/5c20ab52E35e5a500/02e3c1f89cd3dad1.png)
 
+## ⌨️ 本地开发
+
+你可以使用 Gitpod 进行在线开发:
+
+[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/jdf2e/nutui.git)
+
+或者克隆到本地开发:
+
+```bash
+$ git clone https://github.com/jdf2e/nutui.git
+$ cd nutui
+$ npm install
+$ npm run dev
+```
 
 ## 开源协议
 

+ 1 - 1
loader/md-vue/card-wrapper.js

@@ -10,7 +10,7 @@ module.exports = function cardWrapper(html) {
   return group
     .map(fragment => {
       if (fragment.indexOf('<h3') !== -1) {
-        return `<div class="card my-card">${fragment}</div>`;
+        return `<div>${fragment}</div>`;
       }
 
       return fragment;

+ 15 - 0
loader/md-vue/code-wrapper.js

@@ -0,0 +1,15 @@
+/*
+处理code
+*/
+module.exports = function codeWrapper(html) {
+  const group = html.replace(/<\/pre>/g, '</pre>:::').split(':::');
+  const codeOnline = `<div class="handle-part"><a href="https://gitpod.io/#https://github.com/jdf2e/nutui.git" target="_blank" class="online-btn">在线运行</a></div>`;
+  return group
+    .map(fragment => {
+      if (fragment.indexOf('</div>demo') !== -1) {
+        return fragment.replace('<p></div>demo</p>', '') + codeOnline;
+      }
+      return fragment;
+    })
+    .join('');
+};

+ 3 - 0
loader/md-vue/index.js

@@ -5,10 +5,13 @@ const frontMatter = require('front-matter'); //就是md文档最上面的内容
 const highlight = require('./highlight');
 const linkOpen = require('./link-open');
 const cardWrapper = require('./card-wrapper');
+const codeWrapper = require('./code-wrapper');
+
 const { slugify } = require('transliteration');
 
 function wrapper(content) {
   content = cardWrapper(content);
+  content = codeWrapper(content);
   content = escape(content);
 
   return `

+ 204 - 194
package-lock.json

@@ -14,9 +14,9 @@
       }
     },
     "@babel/compat-data": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz",
-      "integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz",
+      "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==",
       "dev": true
     },
     "@babel/core": {
@@ -58,12 +58,12 @@
       }
     },
     "@babel/generator": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
-      "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz",
+      "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.12.1",
+        "@babel/types": "^7.12.5",
         "jsesc": "^2.5.1",
         "source-map": "^0.5.0"
       },
@@ -96,14 +96,14 @@
       }
     },
     "@babel/helper-compilation-targets": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz",
-      "integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz",
+      "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==",
       "dev": true,
       "requires": {
-        "@babel/compat-data": "^7.12.1",
+        "@babel/compat-data": "^7.12.5",
         "@babel/helper-validator-option": "^7.12.1",
-        "browserslist": "^4.12.0",
+        "browserslist": "^4.14.5",
         "semver": "^5.5.0"
       },
       "dependencies": {
@@ -198,12 +198,12 @@
       }
     },
     "@babel/helper-module-imports": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
-      "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz",
+      "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.12.1"
+        "@babel/types": "^7.12.5"
       }
     },
     "@babel/helper-module-transforms": {
@@ -259,15 +259,15 @@
       }
     },
     "@babel/helper-replace-supers": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz",
-      "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz",
+      "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==",
       "dev": true,
       "requires": {
         "@babel/helper-member-expression-to-functions": "^7.12.1",
         "@babel/helper-optimise-call-expression": "^7.10.4",
-        "@babel/traverse": "^7.12.1",
-        "@babel/types": "^7.12.1"
+        "@babel/traverse": "^7.12.5",
+        "@babel/types": "^7.12.5"
       }
     },
     "@babel/helper-simple-access": {
@@ -321,14 +321,14 @@
       }
     },
     "@babel/helpers": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz",
-      "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz",
+      "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==",
       "dev": true,
       "requires": {
         "@babel/template": "^7.10.4",
-        "@babel/traverse": "^7.12.1",
-        "@babel/types": "^7.12.1"
+        "@babel/traverse": "^7.12.5",
+        "@babel/types": "^7.12.5"
       }
     },
     "@babel/highlight": {
@@ -395,9 +395,9 @@
       }
     },
     "@babel/parser": {
-      "version": "7.12.3",
-      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
-      "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw=="
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz",
+      "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ=="
     },
     "@babel/plugin-proposal-async-generator-functions": {
       "version": "7.12.1",
@@ -482,9 +482,9 @@
       }
     },
     "@babel/plugin-proposal-numeric-separator": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz",
-      "integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz",
+      "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==",
       "dev": true,
       "requires": {
         "@babel/helper-plugin-utils": "^7.10.4",
@@ -1099,9 +1099,9 @@
       }
     },
     "@babel/runtime": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
-      "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz",
+      "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==",
       "dev": true,
       "requires": {
         "regenerator-runtime": "^0.13.4"
@@ -1119,26 +1119,26 @@
       }
     },
     "@babel/traverse": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
-      "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz",
+      "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==",
       "dev": true,
       "requires": {
         "@babel/code-frame": "^7.10.4",
-        "@babel/generator": "^7.12.1",
+        "@babel/generator": "^7.12.5",
         "@babel/helper-function-name": "^7.10.4",
         "@babel/helper-split-export-declaration": "^7.11.0",
-        "@babel/parser": "^7.12.1",
-        "@babel/types": "^7.12.1",
+        "@babel/parser": "^7.12.5",
+        "@babel/types": "^7.12.5",
         "debug": "^4.1.0",
         "globals": "^11.1.0",
         "lodash": "^4.17.19"
       }
     },
     "@babel/types": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
-      "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
+      "version": "7.12.5",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.5.tgz",
+      "integrity": "sha512-gyTcvz7JFa4V45C0Zklv//GmFOAal5fL23OWpBLqc4nZ4Yrz67s4kCNwSK1Gu0MXGTU8mRY3zJYtacLdKXlzig==",
       "requires": {
         "@babel/helper-validator-identifier": "^7.10.4",
         "lodash": "^4.17.19",
@@ -1705,9 +1705,9 @@
       }
     },
     "@types/webpack-dev-server": {
-      "version": "3.11.0",
-      "resolved": "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz",
-      "integrity": "sha512-3+86AgSzl18n5P1iUP9/lz3G3GMztCp+wxdDvVuNhx1sr1jE79GpYfKHL8k+Vht3N74K2n98CuAEw4YPJCYtDA==",
+      "version": "3.11.1",
+      "resolved": "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.1.tgz",
+      "integrity": "sha512-rIb+LtUkKnh7+oIJm3WiMJONd71Q0lZuqGLcSqhZ5qjN9gV/CNmZe7Bai+brnBPZ/KVYOsr+4bFLiNZwjBicLw==",
       "dev": true,
       "requires": {
         "@types/connect-history-api-fallback": "*",
@@ -3022,9 +3022,9 @@
       "dev": true
     },
     "aws4": {
-      "version": "1.10.1",
-      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz",
-      "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==",
+      "version": "1.11.0",
+      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
+      "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
       "dev": true
     },
     "babel-code-frame": {
@@ -3461,15 +3461,15 @@
       }
     },
     "browserslist": {
-      "version": "4.14.5",
-      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz",
-      "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==",
+      "version": "4.14.6",
+      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz",
+      "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==",
       "dev": true,
       "requires": {
-        "caniuse-lite": "^1.0.30001135",
-        "electron-to-chromium": "^1.3.571",
-        "escalade": "^3.1.0",
-        "node-releases": "^1.1.61"
+        "caniuse-lite": "^1.0.30001154",
+        "electron-to-chromium": "^1.3.585",
+        "escalade": "^3.1.1",
+        "node-releases": "^1.1.65"
       }
     },
     "buffer": {
@@ -3647,6 +3647,16 @@
         }
       }
     },
+    "call-bind": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz",
+      "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==",
+      "dev": true,
+      "requires": {
+        "function-bind": "^1.1.1",
+        "get-intrinsic": "^1.0.0"
+      }
+    },
     "call-me-maybe": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
@@ -3725,9 +3735,9 @@
       }
     },
     "caniuse-lite": {
-      "version": "1.0.30001153",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001153.tgz",
-      "integrity": "sha512-qv14w7kWwm2IW7DBvAKWlCqGTmV2XxNtSejJBVplwRjhkohHuhRUpeSlPjtu9erru0+A12zCDUiSmvx/AcqVRA==",
+      "version": "1.0.30001154",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz",
+      "integrity": "sha512-y9DvdSti8NnYB9Be92ddMZQrcOe04kcQtcxtBx4NkB04+qZ+JUWotnXBJTmxlKudhxNTQ3RRknMwNU2YQl/Org==",
       "dev": true
     },
     "case-sensitive-paths-webpack-plugin": {
@@ -5381,9 +5391,9 @@
       "dev": true
     },
     "electron-to-chromium": {
-      "version": "1.3.584",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.584.tgz",
-      "integrity": "sha512-NB3DzrTzJFhWkUp+nl2KtUtoFzrfGXTir2S+BU4tXGyXH9vlluPuFpE3pTKeH7+PY460tHLjKzh6K2+TWwW+Ww==",
+      "version": "1.3.586",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.586.tgz",
+      "integrity": "sha512-or8FCbQCRlPZHkOoqBULOI9hzTiStVIQqDLgAPt8pzY+swTrW+89vsqd24Zn+Iv4guAJLxRBD6OR5AmbpabGDA==",
       "dev": true
     },
     "elliptic": {
@@ -5509,9 +5519,9 @@
       }
     },
     "es-abstract": {
-      "version": "1.18.0-next.1",
-      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
-      "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+      "version": "1.17.7",
+      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
+      "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
       "dev": true,
       "requires": {
         "es-to-primitive": "^1.2.1",
@@ -5519,7 +5529,6 @@
         "has": "^1.0.3",
         "has-symbols": "^1.0.1",
         "is-callable": "^1.2.2",
-        "is-negative-zero": "^2.0.0",
         "is-regex": "^1.1.1",
         "object-inspect": "^1.8.0",
         "object-keys": "^1.1.1",
@@ -6711,6 +6720,17 @@
       "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
       "dev": true
     },
+    "get-intrinsic": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz",
+      "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==",
+      "dev": true,
+      "requires": {
+        "function-bind": "^1.1.1",
+        "has": "^1.0.3",
+        "has-symbols": "^1.0.1"
+      }
+    },
     "get-own-enumerable-property-symbols": {
       "version": "3.0.2",
       "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
@@ -7012,9 +7032,9 @@
       "dev": true
     },
     "highlight.js": {
-      "version": "10.3.1",
-      "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.3.1.tgz",
-      "integrity": "sha512-jeW8rdPdhshYKObedYg5XGbpVgb1/DT4AHvDFXhkU7UnGSIjy9kkJ7zHG7qplhFHMitTSzh5/iClKQk3Kb2RFQ==",
+      "version": "10.3.2",
+      "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.3.2.tgz",
+      "integrity": "sha512-3jRT7OUYsVsKvukNKZCtnvRcFyCJqSEIuIMsEybAXRiFSwpt65qjPd/Pr+UOdYt7WJlt+lj3+ypUsHiySBp/Jw==",
       "dev": true
     },
     "hmac-drbg": {
@@ -7361,9 +7381,9 @@
       }
     },
     "import-fresh": {
-      "version": "3.2.1",
-      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
-      "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz",
+      "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==",
       "dev": true,
       "requires": {
         "parent-module": "^1.0.0",
@@ -7981,13 +8001,21 @@
       }
     },
     "jsonfile": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
-      "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+      "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
       "dev": true,
       "requires": {
         "graceful-fs": "^4.1.6",
-        "universalify": "^1.0.0"
+        "universalify": "^2.0.0"
+      },
+      "dependencies": {
+        "universalify": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+          "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+          "dev": true
+        }
       }
     },
     "jsonparse": {
@@ -8122,20 +8150,20 @@
       }
     },
     "lint-staged": {
-      "version": "10.5.0",
-      "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.0.tgz",
-      "integrity": "sha512-gjC9+HGkBubOF+Yyoj9pd52Qfm/kYB+dRX1UOgWjHKvSDYl+VHkZXlBMlqSZa2cH3Kp5/uNL480sV6e2dTgXSg==",
+      "version": "10.5.1",
+      "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.1.tgz",
+      "integrity": "sha512-fTkTGFtwFIJJzn/PbUO3RXyEBHIhbfYBE7+rJyLcOXabViaO/h6OslgeK6zpeUtzkDrzkgyAYDTLAwx6JzDTHw==",
       "dev": true,
       "requires": {
         "chalk": "^4.1.0",
         "cli-truncate": "^2.1.0",
-        "commander": "^6.0.0",
+        "commander": "^6.2.0",
         "cosmiconfig": "^7.0.0",
-        "debug": "^4.1.1",
+        "debug": "^4.2.0",
         "dedent": "^0.7.0",
         "enquirer": "^2.3.6",
-        "execa": "^4.0.3",
-        "listr2": "^2.6.0",
+        "execa": "^4.1.0",
+        "listr2": "^3.2.2",
         "log-symbols": "^4.0.0",
         "micromatch": "^4.0.2",
         "normalize-path": "^3.0.0",
@@ -8269,9 +8297,9 @@
       }
     },
     "listr2": {
-      "version": "2.6.2",
-      "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz",
-      "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==",
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.2.2.tgz",
+      "integrity": "sha512-AajqcZEUikF2ioph6PfH3dIuxJclhr3i3kHgTOP0xeXdWQohrvJAAmqVcV43/GI987HFY/vzT73jYXoa4esDHg==",
       "dev": true,
       "requires": {
         "chalk": "^4.1.0",
@@ -8280,7 +8308,7 @@
         "indent-string": "^4.0.0",
         "log-update": "^4.0.0",
         "p-map": "^4.0.0",
-        "rxjs": "^6.6.2",
+        "rxjs": "^6.6.3",
         "through": "^2.3.8"
       },
       "dependencies": {
@@ -9300,9 +9328,9 @@
       }
     },
     "node-releases": {
-      "version": "1.1.64",
-      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz",
-      "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==",
+      "version": "1.1.65",
+      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz",
+      "integrity": "sha512-YpzJOe2WFIW0V4ZkJQd/DGR/zdVwc/pI4Nl1CZrBO19FdRcSTmsuhdttw9rsTzzJLrNcSloLiBbEYx1C4f6gpA==",
       "dev": true
     },
     "normalize-package-data": {
@@ -9429,6 +9457,28 @@
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.18.0-next.1"
+      },
+      "dependencies": {
+        "es-abstract": {
+          "version": "1.18.0-next.1",
+          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+          "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+          "dev": true,
+          "requires": {
+            "es-to-primitive": "^1.2.1",
+            "function-bind": "^1.1.1",
+            "has": "^1.0.3",
+            "has-symbols": "^1.0.1",
+            "is-callable": "^1.2.2",
+            "is-negative-zero": "^2.0.0",
+            "is-regex": "^1.1.1",
+            "object-inspect": "^1.8.0",
+            "object-keys": "^1.1.1",
+            "object.assign": "^4.1.1",
+            "string.prototype.trimend": "^1.0.1",
+            "string.prototype.trimstart": "^1.0.1"
+          }
+        }
       }
     },
     "object-keys": {
@@ -9447,13 +9497,13 @@
       }
     },
     "object.assign": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz",
-      "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==",
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
+      "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
       "dev": true,
       "requires": {
+        "call-bind": "^1.0.0",
         "define-properties": "^1.1.3",
-        "es-abstract": "^1.18.0-next.0",
         "has-symbols": "^1.0.1",
         "object-keys": "^1.1.1"
       }
@@ -9466,27 +9516,6 @@
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.0-next.1"
-      },
-      "dependencies": {
-        "es-abstract": {
-          "version": "1.17.7",
-          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
-          "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
-          "dev": true,
-          "requires": {
-            "es-to-primitive": "^1.2.1",
-            "function-bind": "^1.1.1",
-            "has": "^1.0.3",
-            "has-symbols": "^1.0.1",
-            "is-callable": "^1.2.2",
-            "is-regex": "^1.1.1",
-            "object-inspect": "^1.8.0",
-            "object-keys": "^1.1.1",
-            "object.assign": "^4.1.1",
-            "string.prototype.trimend": "^1.0.1",
-            "string.prototype.trimstart": "^1.0.1"
-          }
-        }
       }
     },
     "object.pick": {
@@ -9508,27 +9537,6 @@
         "es-abstract": "^1.17.0-next.1",
         "function-bind": "^1.1.1",
         "has": "^1.0.3"
-      },
-      "dependencies": {
-        "es-abstract": {
-          "version": "1.17.7",
-          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
-          "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
-          "dev": true,
-          "requires": {
-            "es-to-primitive": "^1.2.1",
-            "function-bind": "^1.1.1",
-            "has": "^1.0.3",
-            "has-symbols": "^1.0.1",
-            "is-callable": "^1.2.2",
-            "is-regex": "^1.1.1",
-            "object-inspect": "^1.8.0",
-            "object-keys": "^1.1.1",
-            "object.assign": "^4.1.1",
-            "string.prototype.trimend": "^1.0.1",
-            "string.prototype.trimstart": "^1.0.1"
-          }
-        }
       }
     },
     "obuf": {
@@ -11054,9 +11062,9 @@
       }
     },
     "regenerate": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz",
-      "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==",
+      "version": "1.4.2",
+      "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
+      "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
       "dev": true
     },
     "regenerate-unicode-properties": {
@@ -11101,27 +11109,6 @@
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.0-next.1"
-      },
-      "dependencies": {
-        "es-abstract": {
-          "version": "1.17.7",
-          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
-          "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
-          "dev": true,
-          "requires": {
-            "es-to-primitive": "^1.2.1",
-            "function-bind": "^1.1.1",
-            "has": "^1.0.3",
-            "has-symbols": "^1.0.1",
-            "is-callable": "^1.2.2",
-            "is-regex": "^1.1.1",
-            "object-inspect": "^1.8.0",
-            "object-keys": "^1.1.1",
-            "object.assign": "^4.1.1",
-            "string.prototype.trimend": "^1.0.1",
-            "string.prototype.trimstart": "^1.0.1"
-          }
-        }
       }
     },
     "regexpp": {
@@ -11442,17 +11429,17 @@
       "dev": true
     },
     "sass": {
-      "version": "1.27.1",
-      "resolved": "https://registry.npmjs.org/sass/-/sass-1.27.1.tgz",
-      "integrity": "sha512-Co5i3s4kN0AgXe8ZFfIl4pfjHjPgotT81O68m3buwdj7v3oHjYiWNqp0oXTKXnEqyKU30KAYC5u8uUF4x+BKfw==",
+      "version": "1.28.0",
+      "resolved": "https://registry.npmjs.org/sass/-/sass-1.28.0.tgz",
+      "integrity": "sha512-9FWX/0wuE1KxwfiP02chZhHaPzu6adpx9+wGch7WMOuHy5npOo0UapRI3FNSHva2CczaYJu2yNUBN8cCSqHz/A==",
       "requires": {
         "chokidar": ">=2.0.0 <4.0.0"
       }
     },
     "sass-loader": {
-      "version": "10.0.4",
-      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.0.4.tgz",
-      "integrity": "sha512-zhdZ8qvZM4iL5XjLVEjJLvKWvC+MB+hHgzL2x/Nf7UHpUNmPYsJvypW79bW39g4LZ603dH/dRSsRYzJJIljtdA==",
+      "version": "10.0.5",
+      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.0.5.tgz",
+      "integrity": "sha512-2LqoNPtKkZq/XbXNQ4C64GFEleSEHKv6NPSI+bMC/l+jpEXGJhiRYkAQToO24MR7NU4JRY2RpLpJ/gjo2Uf13w==",
       "requires": {
         "klona": "^2.0.4",
         "loader-utils": "^2.0.0",
@@ -12259,6 +12246,28 @@
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.18.0-next.1"
+      },
+      "dependencies": {
+        "es-abstract": {
+          "version": "1.18.0-next.1",
+          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+          "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+          "dev": true,
+          "requires": {
+            "es-to-primitive": "^1.2.1",
+            "function-bind": "^1.1.1",
+            "has": "^1.0.3",
+            "has-symbols": "^1.0.1",
+            "is-callable": "^1.2.2",
+            "is-negative-zero": "^2.0.0",
+            "is-regex": "^1.1.1",
+            "object-inspect": "^1.8.0",
+            "object-keys": "^1.1.1",
+            "object.assign": "^4.1.1",
+            "string.prototype.trimend": "^1.0.1",
+            "string.prototype.trimstart": "^1.0.1"
+          }
+        }
       }
     },
     "string.prototype.trimstart": {
@@ -12269,6 +12278,28 @@
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.18.0-next.1"
+      },
+      "dependencies": {
+        "es-abstract": {
+          "version": "1.18.0-next.1",
+          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+          "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+          "dev": true,
+          "requires": {
+            "es-to-primitive": "^1.2.1",
+            "function-bind": "^1.1.1",
+            "has": "^1.0.3",
+            "has-symbols": "^1.0.1",
+            "is-callable": "^1.2.2",
+            "is-negative-zero": "^2.0.0",
+            "is-regex": "^1.1.1",
+            "object-inspect": "^1.8.0",
+            "object-keys": "^1.1.1",
+            "object.assign": "^4.1.1",
+            "string.prototype.trimend": "^1.0.1",
+            "string.prototype.trimstart": "^1.0.1"
+          }
+        }
       }
     },
     "string_decoder": {
@@ -13363,27 +13394,6 @@
         "es-abstract": "^1.17.2",
         "has-symbols": "^1.0.1",
         "object.getownpropertydescriptors": "^2.1.0"
-      },
-      "dependencies": {
-        "es-abstract": {
-          "version": "1.17.7",
-          "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
-          "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
-          "dev": true,
-          "requires": {
-            "es-to-primitive": "^1.2.1",
-            "function-bind": "^1.1.1",
-            "has": "^1.0.3",
-            "has-symbols": "^1.0.1",
-            "is-callable": "^1.2.2",
-            "is-regex": "^1.1.1",
-            "object-inspect": "^1.8.0",
-            "object-keys": "^1.1.1",
-            "object.assign": "^4.1.1",
-            "string.prototype.trimend": "^1.0.1",
-            "string.prototype.trimstart": "^1.0.1"
-          }
-        }
       }
     },
     "utila": {
@@ -13480,9 +13490,9 @@
       "dev": true
     },
     "vue-loader": {
-      "version": "15.9.4",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.4.tgz",
-      "integrity": "sha512-58YX00oCYre2/+Hu7wwV/2Bpml15/PUHni8LcmpRF1ofiOZJJ+oYt1g3J8BRyE2ZrkMWiy95fZynnZRmMdErEQ==",
+      "version": "15.9.5",
+      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.5.tgz",
+      "integrity": "sha512-oeMOs2b5o5gRqkxfds10bCx6JeXYTwivRgbb8hzOrcThD2z1+GqEKE3EX9A2SGbsYDf4rXwRg6D5n1w0jO5SwA==",
       "dev": true,
       "requires": {
         "@vue/component-compiler-utils": "^3.1.0",
@@ -13521,9 +13531,9 @@
       }
     },
     "vue-loader-v16": {
-      "version": "npm:vue-loader@16.0.0-beta.9",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.9.tgz",
-      "integrity": "sha512-mu9pg6554GbXDSO8LlxkQM6qUJzUkb/A0FJc9LgRqnU9MCnhzEXwCt1Zx5NObvFpzs2mH2dH/uUCDwL8Qaz9sA==",
+      "version": "npm:vue-loader@16.0.0-beta.10",
+      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.10.tgz",
+      "integrity": "sha512-PflGsj4RHW3tuYFmSPhcozAkds8ELXf8d19twWorQTjcuWxl/Xqb9W1NgfsY7AAkCkkRRYy2FwIX4tSnskfKig==",
       "dev": true,
       "optional": true,
       "requires": {

+ 10 - 10
package.json

@@ -34,26 +34,27 @@
     "dev": "vue-cli-service serve",
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint"
+    "lint": "vue-cli-service lint",
+    "upload": "vue-cli-service build && node ./jd/upload.js"
   },
   "dependencies": {
     "core-js": "^3.6.5",
     "sass": "^1.27.0",
     "sass-loader": "^10.0.4",
     "vue": "^3.0.0",
-    "vue-router": "^4.0.0-0"
+    "vue-router": "^4.0.0-rc.1"
   },
   "devDependencies": {
     "@commitlint/cli": "^11.0.0",
     "@commitlint/config-conventional": "^11.0.0",
     "@typescript-eslint/eslint-plugin": "^2.33.0",
     "@typescript-eslint/parser": "^2.33.0",
-    "@vue/cli-plugin-babel": "~4.5.0",
-    "@vue/cli-plugin-eslint": "~4.5.0",
-    "@vue/cli-plugin-router": "~4.5.0",
-    "@vue/cli-plugin-typescript": "~4.5.0",
-    "@vue/cli-service": "~4.5.0",
-    "@vue/compiler-sfc": "^3.0.0",
+    "@vue/cli-plugin-babel": "~4.5.8",
+    "@vue/cli-plugin-eslint": "~4.5.8",
+    "@vue/cli-plugin-router": "~4.5.8",
+    "@vue/cli-plugin-typescript": "~4.5.8",
+    "@vue/cli-service": "~4.5.8",
+    "@vue/compiler-sfc": "^3.0.2",
     "@vue/eslint-config-prettier": "^6.0.0",
     "@vue/eslint-config-typescript": "^5.0.2",
     "eslint": "^6.7.2",
@@ -87,8 +88,7 @@
     },
     "rules": {
       "vue/no-unused-components": "off",
-      "no-debugger": "off",
-      "no-console": "off"
+      "no-debugger": "off"
     }
   },
   "husky": {

+ 21 - 3
src/config.ts

@@ -8,7 +8,7 @@ export const nav = [
     name: '布局组件',
     packages: [
       {
-        name: 'button',
+        name: 'Button',
         sort: 1,
         cName: '按钮组件',
         type: 'component',
@@ -26,12 +26,30 @@ export const nav = [
     name: '基础组件',
     packages: [
       {
-        name: 'uploader',
+        name: 'Cell',
         sort: 1,
+        cName: '单元格组件',
+        type: 'component',
+        show: true,
+        desc: '展示列表',
+        author: 'richard1015'
+      },
+      {
+        name: 'Uploader',
+        sort: 2,
         cName: '上传组件',
         type: 'component',
         show: true,
-        desc: '',
+        desc: '上传文件、图片',
+        author: 'richard1015'
+      },
+      {
+        name: 'Icon',
+        sort: 3,
+        cName: '图标组件',
+        type: 'component',
+        show: true,
+        desc: '图标',
         author: 'richard1015'
       },
       {

+ 7 - 7
src/packages/button/demo.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="demo">
-    <div class="title">按钮类型</div>
+    <h2>按钮类型</h2>
     <div class="demo-button-row">
       <nut-button type="primary">主要按钮</nut-button>
       <nut-button type="info">信息按钮</nut-button>
@@ -11,27 +11,27 @@
       <nut-button type="warning">警告按钮</nut-button>
       <nut-button type="success">成功按钮</nut-button>
     </div>
-    <div class="title">朴素按钮</div>
+    <h2>朴素按钮</h2>
     <div class="demo-button-row2">
       <nut-button plain type="primary">朴素按钮</nut-button>
       <nut-button plain type="info">朴素按钮</nut-button>
     </div>
-    <div class="title">禁用状态</div>
+    <h2>禁用状态</h2>
     <div class="demo-button-row2">
       <nut-button disabled type="primary">禁用状态</nut-button>
       <nut-button plain disabled type="info">禁用状态</nut-button>
       <nut-button plain disabled type="primary">禁用状态</nut-button>
     </div>
-    <div class="title">按钮形状</div>
+    <h2>按钮形状</h2>
     <div class="demo-button-row2">
       <nut-button shape="square" type="primary">方形按钮</nut-button>
       <nut-button type="info">圆形按钮</nut-button>
     </div>
-    <div class="title">加载状态</div>
+    <h2>加载状态</h2>
 
-    <div class="title">图标按钮</div>
+    <h2>图标按钮</h2>
 
-    <div class="title">按钮尺寸</div>
+    <h2>按钮尺寸</h2>
     <div class="demo-button-row2">
       <div class="demo-button-row2">
         <nut-button block type="primary">通栏按钮</nut-button>

File diff suppressed because it is too large
+ 16 - 6
src/packages/button/doc.md


+ 1 - 1
src/packages/button/index.vue

@@ -64,7 +64,7 @@ export default create({
     const classes = computed(() => {
       const prefixCls = componentName;
       return {
-        [componentName]: true,
+        [prefixCls]: true,
         [`${prefixCls}--${type.value}`]: type.value,
         [`${prefixCls}--${size.value}`]: size.value,
         [`${prefixCls}--${shape.value}`]: shape.value,

+ 24 - 0
src/packages/cell/demo.vue

@@ -0,0 +1,24 @@
+<template>
+  <div class="demo">
+    <h2>基本用法</h2>
+    <nut-cell title="我是标题" desc="描述文字"></nut-cell>
+    <nut-cell title="我是标题" sub-title="副标题描述" desc="描述文字"></nut-cell>
+    <h2>链接</h2>
+    <nut-cell title="链接" is-link></nut-cell>
+    <nut-cell title="URL 跳转" desc="https://jd.com" is-link url="https://jd.com"></nut-cell>
+    <nut-cell title="路由跳转 ’/‘ " to="/"></nut-cell>
+  </div>
+</template>
+
+<script lang="ts">
+import Cell from '@/packages/cell/index.vue';
+import { createComponent } from '@/utils/create';
+const { createDemo } = createComponent('cell');
+export default createDemo({
+  props: {},
+  components: { [Cell.name]: Cell },
+  emits: ['click']
+});
+</script>
+
+<style lang="scss" scoped></style>

+ 3 - 3
src/packages/cell/doc.md

@@ -1,10 +1,10 @@
 # Cell 列表组件
 
-## 介绍
+### 介绍
 
 列表项,可组成列表。
 
-## 安装
+### 安装
 
 ``` javascript
 import { createApp } from 'vue';
@@ -22,7 +22,7 @@ app.use(Cell);
 Cell `to` 有值的时候,跳转路由,`click-cell` 点击 `cell`触发事件
 
 ``` javascript
-
+console.log('');
 ```
 
 ### 单元格大小

+ 49 - 0
src/packages/cell/index.scss

@@ -0,0 +1,49 @@
+.nut-cell {
+  position: relative;
+  display: flex;
+  width: 100%;
+  line-height: 20px;
+  padding: 13px 16px;
+  background: $white;
+  border-radius: 7px;
+  box-shadow: 0px 1px 7px 0px rgba(237, 238, 241, 1);
+  font-size: $cell-title-font;
+  color: $cell-color;
+  margin: 10px 0;
+  &::before {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 100%;
+    height: 100%;
+    background-color: $black;
+    border: inherit;
+    border-color: $black;
+    border-radius: inherit;
+    transform: translate(-50%, -50%);
+    opacity: 0;
+    content: ' ';
+  }
+  &:active::before {
+    opacity: 0.1;
+  }
+  &--clickable {
+    cursor: pointer;
+  }
+
+  &__title {
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+    &-desc {
+      font-size: $cell-title-desc-font;
+    }
+  }
+  &__value {
+    display: inline-block;
+    text-align: right;
+    font-size: $cell-desc-font;
+    color: $cell-desc-color;
+    flex: 1;
+  }
+}

+ 74 - 0
src/packages/cell/index.vue

@@ -0,0 +1,74 @@
+<template>
+  <view :class="classes" @click="handleClick">
+    <view class="nut-cell__title">
+      <template v-if="subTitle">
+        <view class="title">{{ title }}</view>
+        <view class="nut-cell__title-desc">{{ subTitle }}</view>
+      </template>
+      <template v-else>
+        {{ title }}
+      </template>
+    </view>
+    <view v-if="desc" class="nut-cell__value">{{ desc }}</view>
+    <nut-icon v-if="isLink || to" name="right"></nut-icon>
+  </view>
+</template>
+
+<script lang="ts">
+import { toRefs, computed } from 'vue';
+import { createComponent } from '@/utils/create';
+import { useRouter } from 'vue-router';
+import Icon from '@/packages/icon/index.vue';
+const { componentName, create } = createComponent('cell');
+
+export default create({
+  props: {
+    title: { type: String, default: '' },
+    subTitle: { type: String, default: '' },
+    desc: { type: String, default: '' },
+    isLink: { type: Boolean, default: false },
+    to: { type: String, default: '' },
+    replace: { type: Boolean, default: false },
+    url: { type: String, default: '' }
+  },
+  components: {
+    [Icon.name]: Icon
+  },
+  emits: ['click'],
+  setup(props, { emit }) {
+    const { title, to, desc, subTitle, isLink, url, replace } = toRefs(props);
+    const classes = computed(() => {
+      const prefixCls = componentName;
+      return {
+        [prefixCls]: true,
+        [`${prefixCls}--clickable`]: isLink.value || to
+      };
+    });
+
+    const router = useRouter();
+
+    const handleClick = (event: Event) => {
+      emit('click', event);
+      if (to.value && router) {
+        router[replace.value ? 'replace' : 'push'](to.value);
+      } else if (url.value) {
+        replace.value ? location.replace(url.value) : (location.href = url.value);
+      }
+    };
+
+    return {
+      handleClick,
+      title,
+      to,
+      subTitle,
+      desc,
+      classes,
+      isLink
+    };
+  }
+});
+</script>
+
+<style lang="scss">
+@import 'index.scss';
+</style>

+ 18 - 0
src/packages/icon/demo.vue

@@ -0,0 +1,18 @@
+<template>
+  <div class="demo">
+    icon
+  </div>
+</template>
+
+<script lang="ts">
+import Icon from '@/packages/icon/index.vue';
+import { createComponent } from '@/utils/create';
+const { createDemo } = createComponent('icon');
+export default createDemo({
+  props: {},
+  components: { [Icon.name]: Icon },
+  emits: ['click']
+});
+</script>
+
+<style lang="scss" scoped></style>

+ 16 - 0
src/packages/icon/doc.md

@@ -0,0 +1,16 @@
+# Icon 列表组件
+
+### 介绍
+
+图标组件
+
+### 安装
+
+``` javascript
+import { createApp } from 'vue';
+import { Icon } from '@nutui/nutui';
+
+const app = createApp();
+app.use(Icon);
+
+```

+ 6 - 0
src/packages/icon/index.scss

@@ -0,0 +1,6 @@
+.nut-icon {
+  width: 20px;
+  height: 20px;
+  line-height: 20px;
+  text-align: right;
+}

+ 42 - 0
src/packages/icon/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <view :class="classes" @click="handleClick">
+    >
+  </view>
+</template>
+
+<script lang="ts">
+import { toRefs, computed } from 'vue';
+import { createComponent } from '@/utils/create';
+const { componentName, create } = createComponent('icon');
+
+export default create({
+  props: {
+    name: { type: String, default: '' }
+  },
+  components: {},
+  emits: ['click'],
+  setup(props, { emit }) {
+    const { name } = toRefs(props);
+    const classes = computed(() => {
+      const prefixCls = componentName;
+      return {
+        [prefixCls]: true
+      };
+    });
+
+    const handleClick = (event: Event) => {
+      emit('click', event);
+    };
+
+    return {
+      handleClick,
+      name,
+      classes
+    };
+  }
+});
+</script>
+
+<style lang="scss">
+@import 'index.scss';
+</style>

BIN
src/sites/assets/images/header-bg.png


src/styles/highlight.scss → src/sites/assets/styles/highlight.scss


+ 64 - 21
src/styles/md-style.scss

@@ -1,8 +1,12 @@
 @import 'highlight.scss';
+
 .doc-content-document {
   position: relative;
   margin: 10px;
   width: 800px;
+  background: #fff;
+  border-left: 1px solid #eee;
+  padding-left: 58px;
   .card {
     margin-bottom: 24px;
     padding: 24px;
@@ -32,7 +36,7 @@
   h5,
   h6 {
     color: $nutui-doc-black;
-    font-weight: normal;
+    font-weight: bold;
     line-height: 1.5;
 
     &[id] {
@@ -43,18 +47,31 @@
   h1 {
     margin: 0 0 30px;
     font-size: 30px;
-    cursor: default;
+    cursor: #1a1a1a;
+    font-weight: bold;
+    position: relative;
+    margin-bottom: 56px;
+    &:after {
+      content: '';
+      position: absolute;
+      bottom: -26px;
+      left: 43px;
+      width: 44px;
+      height: 17px;
+      background: url('https://img10.360buyimg.com/imagetools/jfs/t1/136135/19/14659/946/5fa20aa8E33a9aa26/d329fbe669171208.png');
+      background-size: 100% 100%;
+    }
   }
 
   h2 {
     margin: 45px 0 20px;
-    font-size: 25px;
+    font-size: 24px;
   }
 
   h3 {
-    margin-bottom: 16px;
+    margin: 16px 0px;
     font-weight: 600;
-    font-size: 18px;
+    font-size: 20px;
   }
 
   h4 {
@@ -71,10 +88,15 @@
 
   p {
     color: $nutui-doc-text-color;
-    font-size: 15px;
-    line-height: 26px;
+    font-size: 14px;
+    line-height: 22px;
+  }
+  strong {
+    margin: 24px 0 12px;
+    font-weight: bold;
+    font-size: 14px;
+    color: #333;
   }
-
   table {
     width: 100%;
     margin-top: 12px;
@@ -82,15 +104,16 @@
     font-size: 14px;
     line-height: 1.5;
     border-collapse: collapse;
-
+    border: 1px solid #eee;
     th {
-      padding: 8px 10px;
+      padding: 8px 20px;
       font-weight: 600;
       text-align: left;
-
-      &:first-child {
-        padding-left: 0;
-      }
+      border-left: 1px solid #e9e9e9;
+      background-color: #f7f8fa;
+      // &:first-child {
+      //   padding-left: 0;
+      // }
 
       &:last-child {
         padding-right: 0;
@@ -98,12 +121,12 @@
     }
 
     td {
-      padding: 8px;
+      padding: 8px 20px;
       border-top: 1px solid $nutui-doc-code-background-color;
-
+      border-left: 1px solid #e9e9e9;
       &:first-child {
-        padding-left: 0;
-
+        // padding-left: 0;
+        border-left: 0px;
         // version tag
         code {
           margin: 0;
@@ -183,10 +206,13 @@
   }
 
   blockquote {
-    margin: 16px 0 0;
+    margin: 16px 0px;
     padding: 16px;
-    background-color: #ecf9ff;
-    border-radius: $nutui-doc-border-radius;
+    background-color: #fff4f0;
+    border-left: 6px solid #fa192c;
+    p {
+      color: #1a1a1a;
+    }
   }
 
   img {
@@ -215,4 +241,21 @@
       }
     }
   }
+  .handle-part {
+    height: 50px;
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    .online-btn {
+      display: block;
+      color: #5555e2;
+      background-color: #fff;
+      font-size: 14px;
+      cursor: pointer;
+      &:hover {
+        color: blue;
+        text-decoration: underline;
+      }
+    }
+  }
 }

+ 28 - 27
src/sites/assets/styles/reset.scss

@@ -51,48 +51,48 @@ section,
 time,
 audio,
 video {
-    margin: 0;
-    padding: 0;
-    border: 0;
-    font: inherit;
-    -webkit-overflow-scrolling: touch;
+  margin: 0;
+  padding: 0;
+  border: 0;
+  font: inherit;
+  -webkit-overflow-scrolling: touch;
 }
 
 /* ios默认文本框阴影 */
 
-input[type="text"],
+input[type='text'],
 textarea {
-    -webkit-appearance: none;
+  -webkit-appearance: none;
 }
 
 /* 低版本安卓文本框层级问题 */
 
 input:focus {
-    -webkit-user-modify: read-write-plaintext-only;
+  -webkit-user-modify: read-write-plaintext-only;
 }
 
 // 清除谷歌浏览器下的 search 叉号
 input::-webkit-search-cancel-button {
-    display: none;
+  display: none;
 }
 
 ol,
 ul {
-    list-style: none;
+  list-style: none;
 }
 
 table {
-    border-collapse: collapse;
-    border-spacing: 0;
+  border-collapse: collapse;
+  border-spacing: 0;
 }
 
 * {
-    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-    -webkit-tap-highlight-color: transparent;
-    -webkit-box-sizing: border-box;
-    -moz-box-sizing: border-box;
-    -ms-box-sizing: border-box;
-    box-sizing: border-box;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  -webkit-tap-highlight-color: transparent;
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  -ms-box-sizing: border-box;
+  box-sizing: border-box;
 }
 
 html,
@@ -100,21 +100,22 @@ body,
 a,
 button,
 input {
-    outline: 0 none;
-    border: 0;
-    text-decoration: none;
+  outline: 0 none;
+  border: 0;
+  text-decoration: none;
 }
 
 img {
-    border: 0 none;
-    vertical-align: bottom;
-    -ms-interpolation-mode: bicubic;
+  border: 0 none;
+  vertical-align: bottom;
+  -ms-interpolation-mode: bicubic;
 }
 [v-cloak] {
-    display: none;
+  display: none;
 }
 html,
 body {
-    height: 100%;
-    width: 100%;
+  height: 100%;
+  width: 100%;
+  background: #fff;
 }

+ 27 - 5
src/sites/assets/styles/variables.scss

@@ -1,18 +1,40 @@
 // doc
 $doc-default-color: #fa2c19;
 $doc-default-primary-bg: linear-gradient(
-    135deg,
-    rgba(250, 25, 44, 1) 0%,
-    rgba(250, 39, 40, 1) 45%,
-    rgba(250, 56, 31, 1) 83%,
-    rgba(250, 63, 25, 1) 100%
+  135deg,
+  rgba(250, 25, 44, 1) 0%,
+  rgba(250, 39, 40, 1) 45%,
+  rgba(250, 56, 31, 1) 83%,
+  rgba(250, 63, 25, 1) 100%
 );
 // header
 $doc-default-header-color: $white;
 $doc-header-height: 64px;
+$doc-header-bg: url('../../assets/images/header-bg.png') no-repeat;
 // nav
 $doc-default-nav-bg: $white;
 $doc-default-nav-color: $title-color;
 // footer
 $doc-default-header-color: $white;
 $doc-footer-height: 73px;
+
+//markdown-add-style
+$nutui-doc-black: #323233;
+$nutui-doc-blue: #1989fa;
+$nutui-doc-purple: #8080ff;
+$nutui-doc-fuchsia: #a7419e;
+$nutui-doc-green: #4fc08d;
+$nutui-doc-text-color: #666666;
+$nutui-doc-text-light-blue: rgba(69, 90, 100, 0.6);
+$nutui-doc-background-color: #f7f8fa;
+$nutui-doc-grey: #999;
+$nutui-doc-dark-grey: #666;
+$nutui-doc-light-grey: #ccc;
+$nutui-doc-border-color: #f1f4f8;
+$nutui-doc-code-color: #58727e;
+$nutui-doc-code-background-color: #f1f4f8;
+$nutui-doc-code-font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
+$nutui-doc-padding: 24px;
+$nutui-doc-row-max-width: 1680px;
+$nutui-doc-nav-width: 220px;
+$nutui-doc-border-radius: 20px;

+ 1 - 1
src/sites/doc/App.vue

@@ -15,7 +15,7 @@ export default defineComponent({
   -moz-osx-font-smoothing: grayscale;
   -webkit-text-size-adjust: none;
   -ms-text-size-adjust: 100%;
-  background: #f7f8fa;
+  background: #fff;
   height: 100%;
   width: 100%;
   display: flex;

+ 3 - 1
src/sites/doc/components/Header.vue

@@ -13,7 +13,9 @@ export default defineComponent({
 <style lang="scss">
 .doc {
   &-header {
-    background: $doc-default-primary-bg;
+    background: $doc-header-bg;
+    background-size: cover;
+    background-position: center;
     height: $doc-header-height;
     line-height: $doc-header-height;
     text-align: left;

+ 2 - 0
src/sites/doc/main.ts

@@ -2,6 +2,8 @@ import { createApp } from 'vue';
 import App from './App.vue';
 import router from './router';
 import '@/sites/assets/styles/reset.scss';
+import '@/sites/assets/styles/md-style.scss';
+
 import { isMobile } from '@/sites/assets/util';
 
 if (isMobile) {

+ 3 - 35
src/sites/doc/router.ts

@@ -2,7 +2,7 @@
 import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
 import Index from './views/Index.vue';
 
-const pagesRouter: any = [];
+const pagesRouter: Array<RouteRecordRaw> = [];
 const files = require.context('@/packages', true, /doc\.md$/);
 files.keys().forEach(component => {
   const componentEntity = files(component).default;
@@ -14,47 +14,15 @@ files.keys().forEach(component => {
 const routes: Array<RouteRecordRaw> = [
   {
     path: '/',
-    name: 'index',
+    name: '/',
     component: Index,
     children: pagesRouter
   }
 ];
-// import { nav } from '@/config';
-// nav.forEach(item => {
-//   item.packages.forEach(_item => {
-//     if (_item.show) {
-//       routes.push({
-//         path: `/${_item.name}`,
-//         name: _item.name,
-//         components: {
-//         	main: () => import(`@/packages/${_item.name.toLocaleLowerCase()}/demo.vue`),
-//         }
-//       })
-//     }
-//   })
-// })
-
-// const files = require.context('@/packages', true, /doc\.md$/);
-// files.keys().forEach(component => {
-//   // console.log(component)
-// });
-
-routes.push({
-  name: 'NotFound',
-  path: '/:path(.*)+',
-  redirect: () => '/'
-});
-
-routes.push({
-  name: 'NotFound',
-  path: '/:path(.*)+',
-  redirect: () => '/'
-});
-
 const router = createRouter({
   history: createWebHashHistory(),
   routes,
-  scrollBehavior(to, from, savedPosition) {
+  scrollBehavior(to) {
     if (to.hash) {
       const id = to.hash.split('#')[1];
       const ele = document.getElementById(id);

+ 3 - 11
src/sites/doc/views/Index.vue

@@ -10,14 +10,12 @@
   <doc-footer></doc-footer>
 </template>
 <script lang="ts">
-import { defineComponent, ref, reactive, watch } from 'vue';
-import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
-import { nav, versions } from '@/config';
+import { defineComponent, reactive } from 'vue';
+import { onBeforeRouteUpdate } from 'vue-router';
 import Header from '@/sites/doc/components/Header.vue';
 import Nav from '@/sites/doc/components/Nav.vue';
 import Footer from '@/sites/doc/components/Footer.vue';
 import DemoPreview from '@/sites/doc/components/DemoPreview.vue';
-import '../../../styles/md-style.scss';
 export default defineComponent({
   name: 'doc',
   components: {
@@ -26,18 +24,12 @@ export default defineComponent({
     [Footer.name]: Footer,
     [DemoPreview.name]: DemoPreview
   },
-  setup(prop, { emit, slots }) {
+  setup() {
     const data = reactive({
       demoUrl: 'demo.html'
     });
 
-    // 获取当前路由
-    const route = useRoute();
-    // 获取路由实例
-    const router = useRouter();
-
     onBeforeRouteUpdate(to => {
-      // 当当前路由发生变化时,调用回调函数
       const { origin, pathname } = window.location;
       data.demoUrl = `${origin}${pathname.replace('index.html', '')}demo.html#${to.path}`;
     });

+ 25 - 21
src/sites/mobile/App.vue

@@ -1,10 +1,10 @@
 <template>
-  <div id="nav">{{ title }}</div>
+  <div v-if="title != '/'" id="nav">{{ title }}</div>
   <router-view />
 </template>
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
+import { defineComponent, ref, watch } from 'vue';
+import { useRoute } from 'vue-router';
 
 import { isMobile } from '@/sites/assets/util';
 export default defineComponent({
@@ -12,24 +12,27 @@ export default defineComponent({
   components: {},
   setup() {
     const title = ref('NutUI');
-
     // 获取当前路由
     const route = useRoute();
-    // 获取路由实例
-    const router = useRouter();
-
-    onBeforeRouteUpdate(() => {
-      // 当当前路由发生变化时,调用回调函数
-      // const { origin, hash, pathname } = window.top.location;
-      // if (!isMobile && to.href != hash) {
-      //   window.top.location.replace(`${origin}${pathname}#/${to.name}`);
-      //   title.value = to.name;
-      // } else {
-      //   title.value = '';
-      // }
-    });
+    // 当当前路由发生变化时,调用回调函数
+    watch(
+      () => route,
+      () => {
+        const { origin, hash, pathname } = window.top.location;
+        if (!isMobile && route.hash != hash) {
+          // window.top.location.replace(`${origin}${pathname}#/${route.hash}`);
+          title.value = route.name as string;
+        } else {
+          title.value = route.name as string;
+        }
+      },
+      {
+        immediate: true,
+        deep: true
+      }
+    );
 
-    return title;
+    return { title };
   }
 });
 </script>
@@ -54,10 +57,11 @@ export default defineComponent({
     height: 57px;
     line-height: 57px;
     text-align: center;
-    background: #fff;
-    font-family: PingFangSC-Medium;
+    background: $white;
+    font-weight: bold;
     font-size: 20px;
     color: rgba(51, 51, 51, 1);
+    box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.07);
   }
 
   .demo {
@@ -70,7 +74,7 @@ export default defineComponent({
       width: 0;
       background: transparent;
     }
-    .title {
+    > h2 {
       height: 56px;
       line-height: 56px;
       font-size: 14px;

+ 1 - 2
src/sites/mobile/components/Index1.vue

@@ -12,8 +12,7 @@
         <li>{{ _nav.name }}</li>
         <ul>
           <li v-for="_package in _nav.packages" :key="_package">
-            <router-link :to="_package.name.toLocaleLowerCase()">{{ _package.name }}&nbsp;&nbsp;{{ _package.cName }}
-            </router-link>
+            <router-link :to="_package.name.toLocaleLowerCase()">{{ _package.name }}&nbsp;&nbsp;{{ _package.cName }} </router-link>
           </li>
         </ul>
       </ol>

+ 2 - 2
src/sites/mobile/router.ts

@@ -1,9 +1,9 @@
 import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
-import Index from './components/Index1.vue';
+import Index from './components/Index.vue';
 const routes: Array<RouteRecordRaw> = [
   {
     path: '/',
-    name: 'index',
+    name: '/',
     component: Index
   }
 ];

+ 9 - 20
src/styles/variables.scss

@@ -7,6 +7,8 @@ $primary-color-end: #fa6419 !default;
 $help-color: #f5f5f5 !default;
 // 标题常规文字
 $title-color: #1a1a1a !default;
+// 副标题
+$title-color2: #666666 !default;
 // 次内容
 $text-color: #808080 !default;
 // 特殊禁用色
@@ -77,23 +79,10 @@ $button-warning-background-color: linear-gradient(
 $button-plain-background-color: #fff;
 $button-plain-background-color: $white;
 
-//markdown-add-style
-$nutui-doc-black: #323233;
-$nutui-doc-blue: #1989fa;
-$nutui-doc-purple: #8080ff;
-$nutui-doc-fuchsia: #a7419e;
-$nutui-doc-green: #4fc08d;
-$nutui-doc-text-color: #34495e;
-$nutui-doc-text-light-blue: rgba(69, 90, 100, 0.6);
-$nutui-doc-background-color: #f7f8fa;
-$nutui-doc-grey: #999;
-$nutui-doc-dark-grey: #666;
-$nutui-doc-light-grey: #ccc;
-$nutui-doc-border-color: #f1f4f8;
-$nutui-doc-code-color: #58727e;
-$nutui-doc-code-background-color: #f1f4f8;
-$nutui-doc-code-font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
-$nutui-doc-padding: 24px;
-$nutui-doc-row-max-width: 1680px;
-$nutui-doc-nav-width: 220px;
-$nutui-doc-border-radius: 20px;
+// cell
+
+$cell-color: $title-color2;
+$cell-title-font: $font-size-2;
+$cell-title-desc-font: $font-size-1;
+$cell-desc-font: $font-size-2;
+$cell-desc-color: $disable-color;

+ 5 - 0
vue.config.js

@@ -4,6 +4,11 @@ const path = require('path');
 module.exports = {
   productionSourceMap: process.env.NODE_ENV != 'production',
   publicPath: './',
+  devServer: {
+    host: '0.0.0.0',
+    disableHostCheck: true,
+    open: true
+  },
   css: {
     loaderOptions: {
       // 给 sass-loader 传递选项