mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-14 09:41:05 +08:00
Compare commits
No commits in common. "9c9cce00eae47e7a3ef2713ade236a77d2e7e3f3" and "a1d7d3367a69999a03ddcce88d23a67857d9e7ab" have entirely different histories.
9c9cce00ea
...
a1d7d3367a
Binary file not shown.
@ -977,23 +977,3 @@
|
||||
.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,8 +150,6 @@ export default {
|
||||
'shield-o',
|
||||
'guide-o',
|
||||
'cash-o',
|
||||
'link-o',
|
||||
'miniprogram-o',
|
||||
],
|
||||
filled: [
|
||||
// has corresponding outline icon
|
||||
@ -226,10 +224,7 @@ 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_iv4v8nulyz.woff2?t=1649083952952')
|
||||
src: url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.woff2?t=1640074908811')
|
||||
format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.woff?t=1649083952952')
|
||||
url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.woff?t=1640074908811')
|
||||
format('woff'),
|
||||
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.ttf?t=1649083952952')
|
||||
url('https://at.alicdn.com/t/font_2553510_5imfhdc20ag.ttf?t=1640074908811')
|
||||
format('truetype');
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"test": "vant-cli test",
|
||||
"build": "vant-cli build",
|
||||
"build:site": "vant-cli build-site",
|
||||
"release": "cp ../../README.md ./ && vant-cli release && rm ./README.md",
|
||||
"release": "vant-cli release",
|
||||
"release:site": "pnpm build:site && gh-pages -d site-dist --add",
|
||||
"test:watch": "vant-cli test --watch",
|
||||
"test:coverage": "open test/coverage/index.html"
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
import { popupSharedProps, popupSharedPropKeys } from '../popup/shared';
|
||||
|
||||
// Components
|
||||
import { Icon } from '../icon';
|
||||
import { Popup } from '../popup';
|
||||
|
||||
export type ShareSheetOption = {
|
||||
@ -24,6 +23,17 @@ 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',
|
||||
@ -31,16 +41,12 @@ const popupInheritKeys = [
|
||||
'safeAreaInsetBottom',
|
||||
] as const;
|
||||
|
||||
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',
|
||||
};
|
||||
function getIconURL(icon: string) {
|
||||
if (PRESET_ICONS.includes(icon)) {
|
||||
return `https://img.yzcdn.cn/vant/share-sheet-${icon}.png`;
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
const [name, bem, t] = createNamespace('share-sheet');
|
||||
|
||||
@ -92,17 +98,6 @@ 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 (
|
||||
@ -112,7 +107,7 @@ export default defineComponent({
|
||||
class={[bem('option'), className, HAPTICS_FEEDBACK]}
|
||||
onClick={() => onSelect(option, index)}
|
||||
>
|
||||
{renderIcon(icon)}
|
||||
<img src={getIconURL(icon)} class={bem('icon')} />
|
||||
{name && <span class={bem('name')}>{name}</span>}
|
||||
{description && (
|
||||
<span class={bem('option-description')}>{description}</span>
|
||||
|
||||
@ -65,56 +65,12 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
&__icon,
|
||||
&__image-icon {
|
||||
&__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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user