Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-11-25 22:01:09 +08:00
14 changed files with 259 additions and 14 deletions
+6
View File
@@ -151,6 +151,12 @@
align-items: center;
justify-content: center;
height: 100%;
// fix icon vertical align
// see: https://github.com/youzan/vant/issues/7617
&::before {
content: ' ';
}
}
&__icon {
+1 -10
View File
@@ -1,7 +1,5 @@
import { ref, watch, nextTick, onMounted, onBeforeUnmount } from 'vue';
import { createPopper } from '@popperjs/core/lib/popper-lite';
import offsetModifier from '@popperjs/core/lib/modifiers/offset';
import extendsHelper from '@babel/runtime/helpers/esm/extends';
import { createPopper, offsetModifier } from '@vant/popperjs';
// Utils
import { createNamespace } from '../utils';
@@ -14,13 +12,6 @@ import { useClickAway } from '@vant/use';
import Icon from '../icon';
import Popup from '../popup';
// add Object.assign polyfill for popper.js
// see: https://popper.js.org/docs/v2/browser-support/
/* istanbul ignore if */
if (!Object.assign) {
Object.assign = extendsHelper;
}
const [createComponent, bem] = createNamespace('popover');
export default createComponent({
+2 -1
View File
@@ -70,6 +70,7 @@ export default {
{ name: 'Link', icon: 'link' },
{ name: 'Poster', icon: 'poster' },
{ name: 'Qrcode', icon: 'qrcode' },
{ name: 'Weapp Qrcode', icon: 'weapp-qrcode' },
],
],
};
@@ -131,7 +132,7 @@ export default {
| --- | --- | --- |
| name | Option name | _string_ |
| description `v2.8.5` | Option description | _string_ |
| icon | Option iconcan be set to `wechat` `weibo` `qq` `link` `qrcode` `poster` or image URL | _string_ |
| icon | Option iconcan be set to `wechat` `weibo` `qq` `link` `qrcode` `poster` `weapp-qrcode` or image URL | _string_ |
| className | Option className is used to set the class props to the share item | _string_ |
### Events
+2 -1
View File
@@ -82,6 +82,7 @@ export default {
{ name: '复制链接', icon: 'link' },
{ name: '分享海报', icon: 'poster' },
{ name: '二维码', icon: 'qrcode' },
{ name: '小程序码', icon: 'weapp-qrcode' },
],
],
};
@@ -179,7 +180,7 @@ export default {
| --- | --- | --- |
| name | 分享渠道名称 | _string_ |
| description `v2.8.5` | 分享选项描述 | _string_ |
| icon | 图标,可选值为 `wechat` `weibo` `qq` `link` `qrcode` `poster`,支持传入图片 URL | _string_ |
| icon | 图标,可选值为 `wechat` `weibo` `qq` `link` `qrcode` `poster` `weapp-qrcode`,支持传入图片 URL | _string_ |
| className | 分享选项类名 | _string_ |
### Events
+3
View File
@@ -57,6 +57,7 @@ export default {
withDesc: '展示描述信息',
customIcon: '自定义图标',
description: '描述信息',
weappQrcode: '小程序码',
},
'en-US': {
qq: 'QQ',
@@ -72,6 +73,7 @@ export default {
withDesc: 'Show Description',
customIcon: 'Custom Icon',
description: 'Description',
weappQrcode: 'Weapp Qrcode',
},
},
@@ -108,6 +110,7 @@ export default {
{ name: this.t('link'), icon: 'link' },
{ name: this.t('poster'), icon: 'poster' },
{ name: this.t('qrcode'), icon: 'qrcode' },
{ name: this.t('weappQrcode'), icon: 'weapp-qrcode' },
],
];
},
+9 -1
View File
@@ -4,7 +4,15 @@ import { createNamespace, pick } from '../utils';
// Components
import Popup, { popupSharedProps } from '../popup';
const PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
const PRESET_ICONS = [
'qq',
'link',
'weibo',
'wechat',
'poster',
'qrcode',
'weapp-qrcode',
];
function getIconURL(icon) {
if (PRESET_ICONS.indexOf(icon) !== -1) {