diff --git a/.gitignore b/.gitignore
index 02dbd8c87..10f7dc74e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,4 @@ dist
docs/dist
changelog.generated.md
test/coverage
-packages/icon/svg
vetur
diff --git a/build/build-iconfont.js b/build/build-iconfont.js
deleted file mode 100644
index db3d91173..000000000
--- a/build/build-iconfont.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * build iconfont from sketch
- */
-const fs = require('fs-extra');
-const gulp = require('gulp');
-const path = require('path');
-const glob = require('fast-glob');
-const shell = require('shelljs');
-const md5File = require('md5-file');
-const iconfont = require('gulp-iconfont');
-const iconfontCss = require('gulp-iconfont-css');
-const config = require('../packages/icon/config');
-const local = require('../packages/icon/config/template-local');
-
-const iconDir = path.join(__dirname, '../packages/icon');
-const svgDir = path.join(iconDir, 'svg');
-const sketch = path.join(iconDir, 'assets/icons.sketch');
-const template = path.join(iconDir, 'config/template.tpl');
-
-// get md5 from sketch
-const md5 = md5File.sync(sketch).slice(0, 6);
-const ttf = `${config.name}-${md5}.ttf`;
-
-// extract svg from sketch
-// should install sketchtool first
-// install guide: https://developer.sketchapp.com/guides/sketchtool/
-shell.exec(
- `/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool export slices --formats=svg --overwriting=YES --save-for-web=YES --output=${svgDir} ${sketch}`
-);
-
-// remove previous ttf
-const prevTTFs = glob.sync(path.join(iconDir, '*.ttf'));
-prevTTFs.forEach(ttf => fs.removeSync(ttf));
-
-// rename svg
-const icons = [...config.basic, ...config.outline, ...config.filled];
-icons.forEach((icon, index) => {
- const src = path.join(svgDir, icon.src);
- if (fs.existsSync(src)) {
- fs.renameSync(src, path.join(svgDir, icon.css + '.svg'));
- }
-});
-
-// generate ttf from sketch && build icon.css
-gulp.task('ttf', () => {
- return gulp
- .src([`${svgDir}/*.svg`])
- .pipe(
- iconfontCss({
- fontName: config.name,
- path: template,
- targetPath: '../icon/index.less',
- normalize: true,
- firstGlyph: 0xf000,
- cssClass: ttf // this is a trick to pass ttf to template
- })
- )
- .pipe(
- iconfont({
- fontName: ttf.replace('.ttf', ''),
- formats: ['ttf']
- })
- )
- .pipe(gulp.dest(iconDir));
-});
-
-gulp.task('default', ['ttf'], () => {
- // generate icon-local.css
- fs.writeFileSync(path.join(iconDir, 'local.less'), local(config.name, ttf));
-
- // remove svg
- fs.removeSync(svgDir);
-
- // upload ttf to cdn
- shell.exec(`superman cdn /vant ${path.join(iconDir, ttf)}`);
-});
diff --git a/docs/src/demo-common.js b/docs/src/demo-common.js
index 443e04872..08f33523f 100644
--- a/docs/src/demo-common.js
+++ b/docs/src/demo-common.js
@@ -4,7 +4,7 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
-import VantDoc, { DemoBlock, DemoSection } from 'vant-doc';
+import VantDoc, { DemoBlock, DemoSection } from '@vant/doc';
import i18n from '../../packages/mixins/i18n';
import Vant, { Lazyload, Locale } from '../../packages';
import { camelize } from '../../packages/utils';
diff --git a/docs/src/index.js b/docs/src/index.js
index ce9d24984..b217cdc05 100644
--- a/docs/src/index.js
+++ b/docs/src/index.js
@@ -1,6 +1,6 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
-import VantDoc, { progress } from 'vant-doc';
+import VantDoc, { progress } from '@vant/doc';
import App from './DocsApp';
import routes from './router';
import { isMobile } from './utils';
diff --git a/docs/src/mobile.js b/docs/src/mobile.js
index 0a3010637..a3ab59b53 100644
--- a/docs/src/mobile.js
+++ b/docs/src/mobile.js
@@ -1,10 +1,10 @@
import '../../packages/index.less';
import Vue from 'vue';
import VueRouter from 'vue-router';
-import { progress } from 'vant-doc';
+import { progress } from '@vant/doc';
import App from './WapApp';
import routes from './router';
-import 'vant-doc/helper/touch-simulator';
+import '@vant/doc/helper/touch-simulator';
const router = new VueRouter({
mode: 'hash',
diff --git a/package.json b/package.json
index baf024c10..be8bc954f 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,6 @@
"build:style": "gulp --gulpfile ./build/build-style.js",
"build:style-entry": "node build/build-style-entry.js",
"build:changelog": "vant-doc changelog ./changelog.generated.md",
- "build:iconfont": "gulp --gulpfile ./build/build-iconfont.js",
"build:lib": "node build/build-lib.js",
"build:site": "rimraf docs/dist && cross-env NODE_ENV=production webpack --config build/webpack.doc.js && gh-pages -d docs/dist",
"test": "jest",
@@ -60,6 +59,7 @@
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.1.5",
+ "@vant/icons": "^0.0.2",
"vue-lazyload": "1.2.3"
},
"peerDependencies": {
@@ -72,6 +72,7 @@
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.6",
+ "@vant/doc": "^1.0.20",
"@vant/eslint-config": "^1.0.6",
"@vue/server-test-utils": "^1.0.0-beta.26",
"@vue/test-utils": "^1.0.0-beta.26",
@@ -89,8 +90,6 @@
"gh-pages": "^2.0.1",
"gulp": "^4.0.0",
"gulp-csso": "^3.0.1",
- "gulp-iconfont": "^10.0.2",
- "gulp-iconfont-css": "^2.3.0",
"gulp-less": "^4.0.1",
"gulp-postcss": "^8.0.0",
"html-webpack-plugin": "3.2.0",
@@ -101,7 +100,6 @@
"less-loader": "^4.1.0",
"lint-staged": "^8.1.0",
"markdown-vetur": "0.0.5",
- "md5-file": "^4.0.0",
"postcss": "^7.0.6",
"postcss-loader": "^3.0.0",
"progress-bar-webpack-plugin": "^1.11.0",
@@ -113,7 +111,6 @@
"stylelint-config-standard": "^18.2.0",
"uppercamelcase": "^3.0.0",
"url-loader": "^1.1.2",
- "vant-doc": "1.0.20",
"vue": "2.5.21",
"vue-jest": "^3.0.1",
"vue-loader": "^15.4.2",
diff --git a/packages/icon/CHANGELOG.temp b/packages/icon/CHANGELOG.temp
new file mode 100644
index 000000000..6056e98be
--- /dev/null
+++ b/packages/icon/CHANGELOG.temp
@@ -0,0 +1,21 @@
+缺少:
+- exchange-record
+- add2
+- new
+
+移除:
+- edit-data
+- pending-deliver
+- pending-evaluate
+- points-mall
+
+重命名:
+- password-view -> eye
+- password-not-view -> closed-eye
+- check -> circle
+- warn -> info
+- value-card -> balance-o
+- question2 -> question
+- receive-gift -> gift
+- pending-orders -> orders-o
+- gift-card-pay -> gift-card
diff --git a/packages/icon/assets/icons.sketch b/packages/icon/assets/icons.sketch
deleted file mode 100644
index 676c0b98d..000000000
Binary files a/packages/icon/assets/icons.sketch and /dev/null differ
diff --git a/packages/icon/config/index.js b/packages/icon/config/index.js
deleted file mode 100644
index 574b98dc2..000000000
--- a/packages/icon/config/index.js
+++ /dev/null
@@ -1,413 +0,0 @@
-module.exports = {
- name: 'vant-icon',
- basic: [
- {
- src: 'success.svg',
- css: 'success'
- },
- {
- src: 'cross.svg',
- css: 'cross'
- },
- {
- src: 'fail.svg',
- css: 'fail'
- },
- {
- src: 'arrow.svg',
- css: 'arrow'
- },
- {
- src: 'arrow-left.svg',
- css: 'arrow-left'
- },
- {
- src: 'arrow-up.svg',
- css: 'arrow-up'
- },
- {
- src: 'arrow-down.svg',
- css: 'arrow-down'
- }
- ],
- outline: [
- {
- src: 'close.svg',
- css: 'close'
- },
- {
- src: '升级地址.svg',
- css: 'upgrade'
- },
- {
- src: '加购2.svg',
- css: 'add-o'
- },
- {
- src: '认证通过.svg',
- css: 'passed'
- },
- {
- src: '客服.svg',
- css: 'chat'
- },
- {
- src: '答疑.svg',
- css: 'question'
- },
- {
- src: 'clock.svg',
- css: 'clock'
- },
- {
- src: '金币.svg',
- css: 'gold-coin'
- },
- {
- src: '播放.svg',
- css: 'play'
- },
- {
- src: '暂停.svg',
- css: 'pause'
- },
- {
- src: '停止.svg',
- css: 'stop'
- },
- {
- src: 'more-o.svg',
- css: 'more-o'
- },
- {
- src: 'info-o.svg',
- css: 'info-o'
- },
- {
- src: 'share.svg',
- css: 'share'
- },
- {
- src: 'aim.svg',
- css: 'aim'
- },
- {
- src: '喜欢.svg',
- css: 'like-o'
- },
- {
- src: 'star-o.svg',
- css: 'star-o'
- },
- {
- src: '物流.svg',
- css: 'logistics'
- },
- {
- src: 'edit.svg',
- css: 'edit'
- },
- {
- src: '兑换.svg',
- css: 'exchange'
- },
- {
- src: 'location.svg',
- css: 'location'
- },
- {
- src: '购物车2.svg',
- css: 'cart'
- },
- {
- src: '店铺.svg',
- css: 'shop'
- },
- {
- src: '送礼.svg',
- css: 'gift'
- },
- {
- src: '联系人.svg',
- css: 'contact'
- },
- {
- src: 'wap首页.svg',
- css: 'wap-home'
- },
- {
- src: '积分.svg',
- css: 'points'
- },
- {
- src: '折扣.svg',
- css: 'discount'
- },
- {
- src: '积分礼包.svg',
- css: 'point-gift'
- },
- {
- src: '售后.svg',
- css: 'after-sale'
- },
- {
- src: '编辑资料.svg',
- css: 'edit-data'
- },
- {
- src: '删除.svg',
- css: 'delete'
- },
- {
- src: '记录.svg',
- css: 'records'
- },
- {
- src: '已完成.svg',
- css: 'completed'
- },
- {
- src: '认证.svg',
- css: 'certificate'
- },
- {
- src: '待发货2.svg',
- css: 'tosend'
- },
- {
- src: '已完成2.svg',
- css: 'sign'
- },
- {
- src: 'photo.svg',
- css: 'photo'
- },
- {
- src: 'idcard.svg',
- css: 'idcard'
- },
- {
- src: '首页.svg',
- css: 'home'
- },
- {
- src: '包邮.svg',
- css: 'free-postage'
- },
- {
- src: '返现记录.svg',
- css: 'cash-back-record'
- },
- {
- src: '积分商城.svg',
- css: 'points-mall'
- },
- {
- src: '兑换记录.svg',
- css: 'exchange-record'
- },
- {
- src: '待付款.svg',
- css: 'pending-payment'
- },
- {
- src: '待接单.svg',
- css: 'pending-orders'
- },
- {
- src: '待发货.svg',
- css: 'pending-deliver'
- },
- {
- src: '待评价.svg',
- css: 'pending-evaluate'
- },
- {
- src: '密码可见.svg',
- css: 'password-view'
- },
- {
- src: '密码不见.svg',
- css: 'password-not-view'
- },
- {
- src: '单选.svg',
- css: 'check'
- },
- {
- src: '搜索.svg',
- css: 'search'
- },
- {
- src: '购物车3.svg',
- css: 'cart-o'
- }
- ],
- filled: [
- {
- src: '加购.svg',
- css: 'add'
- },
- {
- src: 'checked.svg',
- css: 'checked'
- },
- {
- src: 'warn.svg',
- css: 'warn'
- },
- {
- src: '清除搜索.svg',
- css: 'clear'
- },
- {
- src: 'underway.svg',
- css: 'underway'
- },
- {
- src: 'more.svg',
- css: 'more'
- },
- {
- src: '喜欢2.svg',
- css: 'like'
- },
- {
- src: 'star.svg',
- css: 'star'
- },
- {
- src: '拍照.svg',
- css: 'photograph'
- },
- {
- src: '二维码失效.svg',
- css: 'qr-invalid'
- },
- {
- src: '二维码.svg',
- css: 'qr'
- },
- {
- src: '添加.svg',
- css: 'add2'
- },
- {
- src: '微信支付.svg',
- css: 'wechat'
- },
- {
- src: '支付宝支付.svg',
- css: 'alipay'
- },
- {
- src: 'wap导航.svg',
- css: 'wap-nav'
- },
- {
- src: '有赞E卡.svg',
- css: 'ecard-pay'
- },
- {
- src: '余额支付.svg',
- css: 'balance-pay'
- },
- {
- src: '找人代付.svg',
- css: 'peer-pay'
- },
- {
- src: '信用卡支付.svg',
- css: 'credit-pay'
- },
- {
- src: '借记卡支付.svg',
- css: 'debit-pay'
- },
- {
- src: '其他支付方式.svg',
- css: 'other-pay'
- },
- {
- src: '购物车1.svg',
- css: 'shopping-cart'
- },
- {
- src: '浏览记录.svg',
- css: 'browsing-history'
- },
- {
- src: '商品收藏.svg',
- css: 'goods-collect'
- },
- {
- src: '店铺收藏.svg',
- css: 'shop-collect'
- },
- {
- src: '收礼物.svg',
- css: 'receive-gift'
- },
- {
- src: '送出赠品.svg',
- css: 'send-gift'
- },
- {
- src: '设置.svg',
- css: 'setting'
- },
- {
- src: '优惠券.svg',
- css: 'coupon'
- },
- {
- src: '礼品卡支付.svg',
- css: 'gift-card-pay'
- },
- {
- src: '货到付款.svg',
- css: 'cash-on-deliver'
- },
- {
- src: '电话.svg',
- css: 'phone'
- },
- {
- src: '描述.svg',
- css: 'description'
- },
- {
- src: '卡.svg',
- css: 'card'
- },
- {
- src: '会员余额.svg',
- css: 'value-card'
- },
- {
- src: '礼卡.svg',
- css: 'gift-card'
- },
- {
- src: 'HOT.svg',
- css: 'hot'
- },
- {
- src: 'NEW.svg',
- css: 'new'
- },
- {
- src: '新品.svg',
- css: 'new-arrival'
- },
- {
- src: '热卖.svg',
- css: 'hot-sale'
- },
- {
- src: 'question2.svg',
- css: 'question2'
- }
- ]
-};
diff --git a/packages/icon/config/template-local.js b/packages/icon/config/template-local.js
deleted file mode 100644
index 136089ce6..000000000
--- a/packages/icon/config/template-local.js
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = (fontName, ttf) => `@font-face {
- font-style: normal;
- font-weight: normal;
- font-family: '${fontName}';
- src: url('./${ttf}') format('truetype');
-}
-`;
diff --git a/packages/icon/config/template.tpl b/packages/icon/config/template.tpl
deleted file mode 100644
index 9dd3d47dd..000000000
--- a/packages/icon/config/template.tpl
+++ /dev/null
@@ -1,42 +0,0 @@
-@import '../style/var';
-
-@font-face {
- font-style: normal;
- font-weight: normal;
- font-family: '<%= fontName %>';
- src: url('https://img.yzcdn.cn/vant/<%= cssClass %>') format('truetype');
-}
-
-.van-icon {
- position: relative;
- display: inline-block;
- font: normal normal normal 14px/1 "<%= fontName %>";
- font-size: inherit;
- text-rendering: auto;
-
- &--image {
- width: 1em;
- height: 1em;
-
- img {
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- max-width: 100%;
- max-height: 100%;
- position: absolute;
- }
- }
-
- &::before {
- display: inline-block;
- }
-}
-
-<% _.each(glyphs, function(glyph) { %>.van-icon-<%= glyph.fileName %>::before {
- content: "\<%= glyph.codePoint %>";
-}
-
-<% }); %>
\ No newline at end of file
diff --git a/packages/icon/demo/index.vue b/packages/icon/demo/index.vue
index 31c7577e1..ecc04807b 100644
--- a/packages/icon/demo/index.vue
+++ b/packages/icon/demo/index.vue
@@ -6,9 +6,9 @@
>
{{ icon }}
@@ -16,9 +16,9 @@
{{ icon }}
@@ -26,9 +26,9 @@
{{ icon }}
@@ -39,7 +39,7 @@