yyued / share-sheet

share sheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

share-sheet

Share Sheet 是一个基于 Vue.js 的用于 Web 打开 APP 客户端的一体化方案,兼容 iOS 与 Android,支持微信开放标签 <wx-open-launch-app>

npm

  • 唤起 APP 的逻辑详见 yypkg/appCall
  • UI 组件建议通过 git clone 直接放到项目中使用,如使用 npm 安装,请配置 vue loader;

DEOM

使用

git clone https://github.com/yyued/share-sheet.git
import shareSheet from '@/components/share-sheet'
Vue.use(shareSheet)

// 初始化
const url = encodeURIComponent(window.location.href)
this.$shareSheet({
  wechatOpenTag: {
    enable: true,
    appID: 'xxx',
    extInfo: ''
  },
  appInfo: {
    name: 'FIMO',
    description: '还原真实胶卷体验',
    icon: 'https://iovo-oss.yy.com/upload/1599048092406236UUHtCU.png',
    buttonText: '打开',
    buttonTextColor: '#fff',
    buttonBackgroundColor: '#121212'
  },
  universalLink: `https://fimoapp.com?url=${url}`,
  schemaUrl: `fimo://fimoapp.com?url=${url}`,
  fallbackUrl: 'https://fimoapp.com'
})

参数

参数 是否必填 默认值 说明
wechatOpenTag 微信开放标签 <wx-open-launch-app> 相关参数
wechatOpenTag.enable 使用启用微信开放标签
wechatOpenTag.appID appid
wechatOpenTag.extInfo extInfo
appInfo APP 信息
appInfo.name APP 名称
appInfo.description APP 描述
appInfo.icon APP logo
appInfo.buttonText APP 按钮文案
appInfo.buttonTextColor APP 按钮文本颜色
appInfo.buttonBackgroundColor APP 按钮背景颜色
universalLink universal links
schemaUrl URL Schema
fallbackUrl fallback 链接,当打开 APP 失败时跳转到该链接

About

share sheet

License:MIT License


Languages

Language:Vue 86.6%Language:TypeScript 13.4%