Code Monkey home page Code Monkey logo

Comments (5)

fa-ge avatar fa-ge commented on July 22, 2024

不依赖任何框架。

from nativeshare.

Jin-Quan-Li avatar Jin-Quan-Li commented on July 22, 2024

我项目是用vue写的 但是我想在我的项目中使用 改怎么用啊 大佬

from nativeshare.

fa-ge avatar fa-ge commented on July 22, 2024

import NativeShare from 'nativeshare'

// 先创建一个实例
var nativeShare = new NativeShare()

// 设置分享文案
nativeShare.setShareData({
icon: 'https://pic3.zhimg.com/v2-080267af84aa0e97c66d5f12e311c3d6_xl.jpg',
link: 'https://github.com/fa-ge/NativeShare',
title: 'NativeShare',
desc: 'NativeShare是一个整合了各大移动端浏览器调用原生分享的插件',
from: '@fa-ge',
})

// 唤起浏览器原生分享组件(如果在微信中不会唤起,此时call方法只会设置文案。类似setShareData)
try {
nativeShare.call()
// 如果是分享到微信则需要 nativeShare.call('wechatFriend')
// 类似的命令下面有介绍
} catch(err) {
// 如果不支持,你可以在这里做降级处理
}

from nativeshare.

hyf1223 avatar hyf1223 commented on July 22, 2024

业务场景:网页应用中设置分享按钮,移动端safari浏览器点击该按钮无法唤醒手机qq。
测试demo:测试时弹出错误提示后跳转至手机qq但无法分享给qq好友。
(PS:按上述作者提示编写的代码)

from nativeshare.

fa-ge avatar fa-ge commented on July 22, 2024

业务场景:网页应用中设置分享按钮,移动端safari浏览器点击该按钮无法唤醒手机qq。
测试demo:测试时弹出错误提示后跳转至手机qq但无法分享给qq好友。
(PS:按上述作者提示编写的代码)

确实。应该是qq从某个版本之后就不支持了,我试了qq空间还可以。safari浏览器可以用通用分享。
https://fa-ge.github.io/NativeShare/demo/index.html

from nativeshare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.