Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2020-08-07 06:33:04 +08:00
84 changed files with 898 additions and 345 deletions
+1
View File
@@ -131,6 +131,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_ |
| className | Option className is used to set the class props to the share item | _string_ |
### Events
+1
View File
@@ -179,6 +179,7 @@ export default {
| name | 分享渠道名称 | _string_ |
| description `v2.8.5` | 分享选项描述 | _string_ |
| icon | 图标,可选值为 `wechat` `weibo` `qq` `link` `qrcode` `poster`,支持传入图片 URL | _string_ |
| className | 分享选项类名 | _string_ |
### Events
+1 -1
View File
@@ -90,7 +90,7 @@ export default createComponent({
<div
role="button"
tabindex="0"
class={bem('option')}
class={[bem('option'), option.className]}
onClick={() => {
this.onSelect(option, index);
}}
+13
View File
@@ -29,6 +29,19 @@ test('description prop', () => {
expect(wrapper.contains('.van-share-sheet__description')).toBeFalsy();
});
test('option className', () => {
const wrapper = mount(ShareSheet, {
propsData: {
value: true,
options: [{ name: 'Link', icon: 'link', className: 'foo' }],
},
});
const option = wrapper.find('.van-share-sheet__option').element;
expect(option.className.includes('foo')).toBeTruthy();
});
test('select event', () => {
const wrapper = mount(ShareSheet, {
propsData: {