npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-social-share

v0.1.8

Published

vue3的快捷分享组件

Downloads

74

Readme

vue3-social-share

作者:PeterAlbus

@Author PeterAlbus

联系邮箱:[email protected]

协议及开源库使用

MIT License

网页二维码的生成使用'qrcodejs2'(qrcodejs2 - npm (npmjs.com)) 在0.1.4后修改为了'qrcode.vue',对vite也拥有了支持

0.1.7进行了优化,使得传入的参数会自动进行url编码

分享栏的图标参考share.js——overtrue/share.js (github.com)

简介

使用该组件需要Vue版本 > 3.2, Vue2用户可使用vue-social-share

使用本组件可以快速获得一个分享栏用于分享当前页面

image-20220123125719460

没什么技术含量,使用TypeScript编写。

如果有高度定制需求可以自己写,原理就是打开这些软件提供的分享链接。

支持:QQ、微博、微信、QQ空间、豆瓣、领英、点点、Facebook、推特、谷歌+

快速开始

安装

npm i vue3-social-share -S

引入

全局引入,在main.js中

import PeterAlbusVue from 'vue3-social-share';
import 'vue3-social-share/lib/index.css'

或按组件单个引用(实际上本库仅有一个组件),在.vue文件中

<script>
import {Share} from 'vue3-social-share';
import 'vue3-social-share/lib/index.css'
    
export default{
    name:'viewName',
    component:{
        Share
    }
}
</script>

使用

<templete>
    <Share></Share>
</templete>

或带上参数

<templete>
    <Share
		:url="baseUrl+blog.blogId"
		:title="blog.blogTitle"
		source="modifySource"
		:description="blog.blogDescription"
		:image="blog.blogImg"
		:twitter="true"
		:google="true"
	></Share>
</templete>

Props 参数列表

| prop | 作用 | 默认值 | 类型 | | ----------- | -------------------------- | ---------------- | ------- | | url | 分享出去的网页链接 | location.href | String | | source | 来源 | 空 | String | | origin | 网站地址 | location.orgin | String | | title | 分享标题 | document.title | String | | description | 分享描述 | 空 | String | | image | 图片url | 空 | String | | QQ | 是否显示QQ的分享图标 | true | Boolean | | weibo | 是否显示新浪微博的分享图标 | true | Boolean | | weChat | 是否显示微信的分享图标 | true | Boolean | | douban | 是否显示豆瓣的分享图标 | false | Boolean | | QZone | 是否显示QQ空间的分享图标 | true | Boolean | | linkedin | 是否显示领英的分享图标 | false | Boolean | | diandian | 是否显示点点的分享图标 | false | Boolean | | facebook | 是否显示脸书的分享图标 | false | Boolean | | twitter | 是否显示推特的分享图标 | false | Boolean | | google | 是否显示Google+的分享图标 | false | Boolean |