[breaking change] Icon: repaint all icons (#1141)

This commit is contained in:
neverland 2018-12-24 20:23:09 +08:00 committed by GitHub
parent e79edf73e2
commit 37b616251c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 846 deletions

View File

@ -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 });

View File

@ -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'
}
]
};

View File

@ -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
},

View File

@ -4,7 +4,7 @@
>
<van-tab title="基础图标" custom-class="demo-tab-pane">
<van-col
wx:for="{{ basic }}"
wx:for="{{ icons.basic }}"
wx:key="index"
custom-class="col"
span="8"
@ -19,7 +19,7 @@
</van-tab>
<van-tab title="线框风格" custom-class="demo-tab-pane">
<van-col
wx:for="{{ outline }}"
wx:for="{{ icons.outline }}"
wx:key="index"
custom-class="col"
span="8"
@ -34,7 +34,7 @@
</van-tab>
<van-tab title="实底风格" custom-class="demo-tab-pane">
<van-col
wx:for="{{ filled }}"
wx:for="{{ icons.filled }}"
wx:key="index"
custom-class="col"
span="8"

View File

@ -26,6 +26,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.6",
"@babel/preset-typescript": "^7.1.0",
"@vant/icons": "^1.0.2",
"autoprefixer": "^9.3.1",
"babel-loader": "8.0.4",
"cross-env": "^5.1.4",

View File

@ -1,19 +1,7 @@
@import '../common/style/var.less';
@font-face {
font-style: normal;
font-weight: normal;
font-family: 'vant-icon';
src: url('https://img.yzcdn.cn/vant/vant-icon-ccd101.ttf') format('truetype');
}
@import '@vant/icons/src/index.less';
.van-icon {
position: relative;
display: inline-block;
font: normal normal normal 14px/1 "vant-icon";
font-size: inherit;
text-rendering: auto;
&--image {
width: 1em;
height: 1em;
@ -29,412 +17,4 @@
position: absolute;
}
}
&::before {
display: inline-block;
}
}
.van-icon-add-o::before {
content: "\F000";
}
.van-icon-add::before {
content: "\F001";
}
.van-icon-add2::before {
content: "\F002";
}
.van-icon-after-sale::before {
content: "\F003";
}
.van-icon-aim::before {
content: "\F004";
}
.van-icon-alipay::before {
content: "\F005";
}
.van-icon-arrow-down::before {
content: "\F006";
}
.van-icon-arrow-left::before {
content: "\F007";
}
.van-icon-arrow-up::before {
content: "\F008";
}
.van-icon-arrow::before {
content: "\F009";
}
.van-icon-balance-pay::before {
content: "\F00A";
}
.van-icon-browsing-history::before {
content: "\F00B";
}
.van-icon-card::before {
content: "\F00C";
}
.van-icon-cart-o::before {
content: "\F00D";
}
.van-icon-cart::before {
content: "\F00E";
}
.van-icon-cash-back-record::before {
content: "\F00F";
}
.van-icon-cash-on-deliver::before {
content: "\F010";
}
.van-icon-certificate::before {
content: "\F011";
}
.van-icon-chat::before {
content: "\F012";
}
.van-icon-check::before {
content: "\F013";
}
.van-icon-checked::before {
content: "\F014";
}
.van-icon-clear::before {
content: "\F015";
}
.van-icon-clock::before {
content: "\F016";
}
.van-icon-close::before {
content: "\F017";
}
.van-icon-completed::before {
content: "\F018";
}
.van-icon-contact::before {
content: "\F019";
}
.van-icon-coupon::before {
content: "\F01A";
}
.van-icon-credit-pay::before {
content: "\F01B";
}
.van-icon-cross::before {
content: "\F01C";
}
.van-icon-debit-pay::before {
content: "\F01D";
}
.van-icon-delete::before {
content: "\F01E";
}
.van-icon-description::before {
content: "\F01F";
}
.van-icon-discount::before {
content: "\F020";
}
.van-icon-ecard-pay::before {
content: "\F021";
}
.van-icon-edit-data::before {
content: "\F022";
}
.van-icon-edit::before {
content: "\F023";
}
.van-icon-exchange-record::before {
content: "\F024";
}
.van-icon-exchange::before {
content: "\F025";
}
.van-icon-fail::before {
content: "\F026";
}
.van-icon-free-postage::before {
content: "\F027";
}
.van-icon-gift-card-pay::before {
content: "\F028";
}
.van-icon-gift-card::before {
content: "\F029";
}
.van-icon-gift::before {
content: "\F02A";
}
.van-icon-gold-coin::before {
content: "\F02B";
}
.van-icon-goods-collect::before {
content: "\F02C";
}
.van-icon-home::before {
content: "\F02D";
}
.van-icon-hot-sale::before {
content: "\F02E";
}
.van-icon-hot::before {
content: "\F02F";
}
.van-icon-idcard::before {
content: "\F030";
}
.van-icon-info-o::before {
content: "\F031";
}
.van-icon-like-o::before {
content: "\F032";
}
.van-icon-like::before {
content: "\F033";
}
.van-icon-location::before {
content: "\F034";
}
.van-icon-logistics::before {
content: "\F035";
}
.van-icon-more-o::before {
content: "\F036";
}
.van-icon-more::before {
content: "\F037";
}
.van-icon-new-arrival::before {
content: "\F038";
}
.van-icon-new::before {
content: "\F039";
}
.van-icon-other-pay::before {
content: "\F03A";
}
.van-icon-passed::before {
content: "\F03B";
}
.van-icon-password-not-view::before {
content: "\F03C";
}
.van-icon-password-view::before {
content: "\F03D";
}
.van-icon-pause::before {
content: "\F03E";
}
.van-icon-peer-pay::before {
content: "\F03F";
}
.van-icon-pending-deliver::before {
content: "\F040";
}
.van-icon-pending-evaluate::before {
content: "\F041";
}
.van-icon-pending-orders::before {
content: "\F042";
}
.van-icon-pending-payment::before {
content: "\F043";
}
.van-icon-phone::before {
content: "\F044";
}
.van-icon-photo::before {
content: "\F045";
}
.van-icon-photograph::before {
content: "\F046";
}
.van-icon-play::before {
content: "\F047";
}
.van-icon-point-gift::before {
content: "\F048";
}
.van-icon-points-mall::before {
content: "\F049";
}
.van-icon-points::before {
content: "\F04A";
}
.van-icon-qr-invalid::before {
content: "\F04B";
}
.van-icon-qr::before {
content: "\F04C";
}
.van-icon-question::before {
content: "\F04D";
}
.van-icon-question2::before {
content: "\F04E";
}
.van-icon-receive-gift::before {
content: "\F04F";
}
.van-icon-records::before {
content: "\F050";
}
.van-icon-search::before {
content: "\F051";
}
.van-icon-send-gift::before {
content: "\F052";
}
.van-icon-setting::before {
content: "\F053";
}
.van-icon-share::before {
content: "\F054";
}
.van-icon-shop-collect::before {
content: "\F055";
}
.van-icon-shop::before {
content: "\F056";
}
.van-icon-shopping-cart::before {
content: "\F057";
}
.van-icon-sign::before {
content: "\F058";
}
.van-icon-star-o::before {
content: "\F059";
}
.van-icon-star::before {
content: "\F05A";
}
.van-icon-stop::before {
content: "\F05B";
}
.van-icon-success::before {
content: "\F05C";
}
.van-icon-tosend::before {
content: "\F05D";
}
.van-icon-underway::before {
content: "\F05E";
}
.van-icon-upgrade::before {
content: "\F05F";
}
.van-icon-value-card::before {
content: "\F060";
}
.van-icon-wap-home::before {
content: "\F061";
}
.van-icon-wap-nav::before {
content: "\F062";
}
.van-icon-warn::before {
content: "\F063";
}
.van-icon-wechat::before {
content: "\F064";
}

View File

@ -696,6 +696,10 @@
version "0.7.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
"@vant/icons@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@vant/icons/-/icons-1.0.2.tgz#13d58d06a88609d036364e0ab657cb1e8136d402"
"@vue/component-compiler-utils@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.1.1.tgz#9b084cb67023076860687002a29930d30b36ef56"