mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-24 22:15:37 +08:00
Compare commits
7 Commits
a1d7d3367a
...
aded0e2d8b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aded0e2d8b | ||
|
|
5fec4f41e4 | ||
|
|
e461abaafa | ||
|
|
f1d5a9415e | ||
|
|
9c9cce00ea | ||
|
|
800d9a6af9 | ||
|
|
c4535ef77c |
@ -1,5 +1,13 @@
|
||||
# 更新日志
|
||||
|
||||
## v4.0.1
|
||||
|
||||
`2022-03-03`
|
||||
|
||||
- 支持复制示例代码到剪贴板
|
||||
- 修复官网更新日志的版本链接及 issue 链接异常的问题
|
||||
- 修复 ReDoS 安全问题
|
||||
|
||||
## v4.0.0
|
||||
|
||||
`2022-02-07`
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
## Changelog
|
||||
|
||||
## 1.8.0
|
||||
|
||||
- add qq icon
|
||||
- add weibo icon
|
||||
- add link-o icon
|
||||
- add miniprogram-o icon
|
||||
- add wechat-moments icon
|
||||
|
||||
## 1.7.3
|
||||
|
||||
- complete https protocol
|
||||
|
||||
Binary file not shown.
@ -14,7 +14,12 @@ Vant 图标库托管在 [iconfont.cn](https://iconfont.cn) 上,同时仓库中
|
||||
|
||||
在 Sketch 中绘制所需的图标,并更新到 `assets/icons.sketch` 文件中。
|
||||
|
||||
绘制图标前,请阅读:[iconfont - 图标绘制](https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.16&helptype=draw)。
|
||||
绘制图标,请遵循以下图标规范:
|
||||
|
||||
- 首先要遵循 [iconfont - 图标绘制](https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.16&helptype=draw) 中的基本规则,保证图标可以正确上传到 iconfont。
|
||||
- 建议采用 `18x18` 规格绘制图标,图标的四周留出 `1px` 空隙,绘制完成后放大至 `1000x1000`。
|
||||
- 绘制线框风格图标时,线条的标准宽度为 `1px`(放大后为 `55.55px`)。
|
||||
- 线框风格图标如果有对应的实底风格图标,需要为名称添加 `-o` 后缀,比如 `star-o` 和 `star` 为一组对应的图标。
|
||||
|
||||
### 2. 上传图标
|
||||
|
||||
@ -26,10 +31,10 @@ Vant 图标库托管在 [iconfont.cn](https://iconfont.cn) 上,同时仓库中
|
||||
|
||||
### 3. 更新代码
|
||||
|
||||
在 iconfont 中将更新后的图标库下载到本地,并更新以下文件:
|
||||
在 iconfont 中更新图标库代码,将新代码下载到本地,并更新以下文件:
|
||||
|
||||
- `src/index.less`: 更新字体文件的 CDN 链接。
|
||||
- `src/encode-woff2.less`: 更新字体文件的 base64 URL。
|
||||
- `src/encode-woff2.less`: 更新字体文件的 base64 URL 和 CDN 链接。
|
||||
|
||||
如果有新增图标,还需要更新以下文件:
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/icons",
|
||||
"version": "1.7.3",
|
||||
"version": "1.8.0",
|
||||
"description": "vant icons",
|
||||
"main": "./src/config.js",
|
||||
"types": "./src/config.d.ts",
|
||||
|
||||
@ -977,3 +977,23 @@
|
||||
.van-icon-cash-o:before {
|
||||
content: '\e74d';
|
||||
}
|
||||
|
||||
.van-icon-qq:before {
|
||||
content: '\e74e';
|
||||
}
|
||||
|
||||
.van-icon-wechat-moments:before {
|
||||
content: '\e74f';
|
||||
}
|
||||
|
||||
.van-icon-weibo:before {
|
||||
content: '\e750';
|
||||
}
|
||||
|
||||
.van-icon-link-o:before {
|
||||
content: '\e751';
|
||||
}
|
||||
|
||||
.van-icon-miniprogram-o:before {
|
||||
content: '\e752';
|
||||
}
|
||||
|
||||
@ -150,6 +150,8 @@ export default {
|
||||
'shield-o',
|
||||
'guide-o',
|
||||
'cash-o',
|
||||
'link-o',
|
||||
'miniprogram-o',
|
||||
],
|
||||
filled: [
|
||||
// has corresponding outline icon
|
||||
@ -224,7 +226,10 @@ export default {
|
||||
// without corresponding outline icon
|
||||
'wechat',
|
||||
'wechat-pay',
|
||||
'wechat-moments',
|
||||
'qq',
|
||||
'alipay',
|
||||
'weibo',
|
||||
'photograph',
|
||||
'youzan-shield',
|
||||
'umbrella-circle',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,10 +5,10 @@
|
||||
font-style: normal;
|
||||
font-display: auto;
|
||||
font-family: 'vant-icon';
|
||||
src: url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.woff2?t=1640074908811')
|
||||
src: url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.woff2?t=1649083952952')
|
||||
format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.woff?t=1640074908811')
|
||||
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.woff?t=1649083952952')
|
||||
format('woff'),
|
||||
url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.ttf?t=1640074908811')
|
||||
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.ttf?t=1649083952952')
|
||||
format('truetype');
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"test": "vant-cli test",
|
||||
"build": "vant-cli build",
|
||||
"build:site": "vant-cli build-site",
|
||||
"release": "vant-cli release",
|
||||
"release": "cp ../../README.md ./ && vant-cli release && rm ./README.md",
|
||||
"release:site": "pnpm build:site && gh-pages -d site-dist --add",
|
||||
"test:watch": "vant-cli test --watch",
|
||||
"test:coverage": "open test/coverage/index.html"
|
||||
@ -61,7 +61,7 @@
|
||||
"components"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vant/icons": "^1.7.1",
|
||||
"@vant/icons": "^1.8.0",
|
||||
"@vant/popperjs": "^1.1.0",
|
||||
"@vant/use": "^1.3.6"
|
||||
},
|
||||
|
||||
@ -12,6 +12,7 @@ import {
|
||||
import { popupSharedProps, popupSharedPropKeys } from '../popup/shared';
|
||||
|
||||
// Components
|
||||
import { Icon } from '../icon';
|
||||
import { Popup } from '../popup';
|
||||
|
||||
export type ShareSheetOption = {
|
||||
@ -23,17 +24,6 @@ export type ShareSheetOption = {
|
||||
|
||||
export type ShareSheetOptions = ShareSheetOption[] | ShareSheetOption[][];
|
||||
|
||||
const PRESET_ICONS = [
|
||||
'qq',
|
||||
'link',
|
||||
'weibo',
|
||||
'wechat',
|
||||
'poster',
|
||||
'qrcode',
|
||||
'weapp-qrcode',
|
||||
'wechat-moments',
|
||||
];
|
||||
|
||||
const popupInheritKeys = [
|
||||
...popupSharedPropKeys,
|
||||
'round',
|
||||
@ -41,12 +31,16 @@ const popupInheritKeys = [
|
||||
'safeAreaInsetBottom',
|
||||
] as const;
|
||||
|
||||
function getIconURL(icon: string) {
|
||||
if (PRESET_ICONS.includes(icon)) {
|
||||
return `https://img.yzcdn.cn/vant/share-sheet-${icon}.png`;
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
const iconMap: Record<string, string> = {
|
||||
qq: 'qq',
|
||||
link: 'link-o',
|
||||
weibo: 'weibo',
|
||||
qrcode: 'qr',
|
||||
poster: 'photo-o',
|
||||
wechat: 'wechat',
|
||||
'weapp-qrcode': 'miniprogram-o',
|
||||
'wechat-moments': 'wechat-moments',
|
||||
};
|
||||
|
||||
const [name, bem, t] = createNamespace('share-sheet');
|
||||
|
||||
@ -98,6 +92,17 @@ export default defineComponent({
|
||||
}
|
||||
};
|
||||
|
||||
const renderIcon = (icon: string) => {
|
||||
if (iconMap[icon]) {
|
||||
return (
|
||||
<div class={bem('icon', [icon])}>
|
||||
<Icon name={iconMap[icon] || icon} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <img src={icon} class={bem('image-icon')} />;
|
||||
};
|
||||
|
||||
const renderOption = (option: ShareSheetOption, index: number) => {
|
||||
const { name, icon, className, description } = option;
|
||||
return (
|
||||
@ -107,7 +112,7 @@ export default defineComponent({
|
||||
class={[bem('option'), className, HAPTICS_FEEDBACK]}
|
||||
onClick={() => onSelect(option, index)}
|
||||
>
|
||||
<img src={getIconURL(icon)} class={bem('icon')} />
|
||||
{renderIcon(icon)}
|
||||
{name && <span class={bem('name')}>{name}</span>}
|
||||
{description && (
|
||||
<span class={bem('option-description')}>{description}</span>
|
||||
|
||||
@ -65,12 +65,56 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
&__icon,
|
||||
&__image-icon {
|
||||
width: var(--van-share-sheet-icon-size);
|
||||
height: var(--van-share-sheet-icon-size);
|
||||
margin: 0 var(--van-padding-md);
|
||||
}
|
||||
|
||||
&__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--van-gray-7);
|
||||
border-radius: 100%;
|
||||
background-color: var(--van-gray-2);
|
||||
|
||||
&--link,
|
||||
&--poster,
|
||||
&--qrcode {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
&--weapp-qrcode {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
&--qq,
|
||||
&--weibo,
|
||||
&--wechat,
|
||||
&--wechat-moments {
|
||||
font-size: 30px;
|
||||
color: var(--van-white);
|
||||
}
|
||||
|
||||
&--qq {
|
||||
background-color: #38b9fa;
|
||||
}
|
||||
|
||||
&--wechat {
|
||||
background-color: #0bc15f;
|
||||
}
|
||||
|
||||
&--weibo {
|
||||
background-color: #ee575e;
|
||||
}
|
||||
|
||||
&--wechat-moments {
|
||||
background-color: #7bc845;
|
||||
}
|
||||
}
|
||||
|
||||
&__name {
|
||||
margin-top: var(--van-padding-xs);
|
||||
padding: 0 var(--van-padding-base);
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@ -52,7 +52,7 @@ importers:
|
||||
'@vant/area-data': ^1.1.3
|
||||
'@vant/cli': workspace:*
|
||||
'@vant/eslint-config': workspace:*
|
||||
'@vant/icons': ^1.7.1
|
||||
'@vant/icons': ^1.8.0
|
||||
'@vant/popperjs': ^1.1.0
|
||||
'@vant/use': ^1.3.6
|
||||
'@vue/runtime-core': ^3.2.27
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user