Vue uses facebook twitter to share examples

亚连
Release: 2018-05-30 14:19:21
Original
4489 people have browsed it

This article mainly introduces the example of Vue using Facebook and Twitter to share. Now I share it with you and give it as a reference.

Record a vue usage share

Sharing reference document for fixed content

facebook sharing document

twitter sharing document

vue uses

facebook and uses sharing

to find index.html and add the code

 

Copy after login

Use in vue

The first way is html

分享

Copy after login

The second way is js

facebook() { // 初始化 FB.init({ appId: 你的appid, autoLogAppEvents: true, xfbml: true, version: "v2.12" }); FB.ui( { method: "share", mobile_iframe: true, href: "http://dev.XXXX.io/?test=12345" }, function(response) {} ); },
Copy after login

twitter Use sharing

Find index.html and add the code

 
Copy after login

Use on the vue page

Add

Copy after login

javascript code in xxx.vue

twitter() { console.log(twttr) twttr.widgets.createShareButton( "http://dev.XXXX.io/?test=12345", document.getElementById("container"), { text: "分享测试", size: "large", hashtags: "example,demo", via: "twitterdev", related: "twitterapi,twitter" } ); }
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future. .

Related articles:

Vue implements active click switching method

Detailed explanation of Vue.js project API and Router configuration split Practice

NodeJS method to implement irreversible encryption and password cipher text storage

The above is the detailed content of Vue uses facebook twitter to share examples. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!