diff --git a/build/dev.js b/build/dev.js index 08323b4f..d05d124c 100644 --- a/build/dev.js +++ b/build/dev.js @@ -3,7 +3,10 @@ const fs = require('fs-extra'); const path = require('path'); const serve = require('webpack-serve'); const config = require('./webpack.doc.dev'); +const dist = path.join(__dirname, '../example/dist'); +const icons = path.join(__dirname, '../node_modules/@vant/icons'); -fs.removeSync(path.join(__dirname, '../example/dist')); +fs.removeSync(dist); +fs.copySync(icons, path.join(dist, '/@vant/icons')); serve({}, { config }); diff --git a/example/pages/icon/config.js b/example/pages/icon/config.js deleted file mode 100644 index c28b4408..00000000 --- a/example/pages/icon/config.js +++ /dev/null @@ -1,413 +0,0 @@ -export default { - 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/example/pages/icon/index.js b/example/pages/icon/index.js index 015ff4e1..02b43364 100644 --- a/example/pages/icon/index.js +++ b/example/pages/icon/index.js @@ -1,15 +1,9 @@ +import icons from '../../dist/@vant/icons/src/config'; import Page from '../../common/page'; -import config from './config'; - -const basic = config.basic.map(item => item.css); -const outline = config.outline.map(item => item.css); -const filled = config.filled.map(item => item.css); Page({ data: { - basic, - outline, - filled, + icons, active: 0 }, diff --git a/example/pages/icon/index.wxml b/example/pages/icon/index.wxml index a7a5ad69..edd41b2e 100644 --- a/example/pages/icon/index.wxml +++ b/example/pages/icon/index.wxml @@ -4,7 +4,7 @@ >