feat: add ShareSheet component

This commit is contained in:
chenjiahan
2020-04-09 13:09:32 +08:00
committed by neverland
parent 8144e3de50
commit 5080761cfe
8 changed files with 356 additions and 1 deletions
+52
View File
@@ -0,0 +1,52 @@
<template>
<demo-section>
<demo-block :title="t('basicUsage')">
<van-cell
is-link
:title="t('showSheet')"
@click="showBasicSheet = true"
/>
<van-share-sheet v-model="showBasicSheet" :options="options" />
</demo-block>
</demo-section>
</template>
<script>
export default {
i18n: {
'zh-CN': {
link: '复制链接',
wechat: '微信',
poster: '分享海报',
qrcode: '二维码',
showSheet: '显示分享面板',
},
'en-US': {
link: 'Link',
wechat: 'Wechat',
poster: 'Poster',
qrcode: 'Qrcode',
showSheet: 'Show ShareSheet',
},
},
data() {
return {
showBasicSheet: false,
};
},
created() {
this.options = [
{ name: this.t('wechat'), icon: 'wechat' },
{ name: this.t('link'), icon: 'link' },
{ name: this.t('poster'), icon: 'poster' },
{ name: this.t('qrcode'), icon: 'qrcode' },
];
},
};
</script>
<style lang="less">
@import '../../style/var';
</style>