1.0.0 • Published 3 years ago
@wangyunling/wxconfig v1.0.0
wxconfig
微信分享配置
接口路径配置:项目根目录下建 wxapi.js
文件,内容是导出微信分享的接口地址
wxapi.js 文件内容格式:export default 'http:/xxx/Index/jsk'
,注意区分线上线下接口地址
需要传的参数:
{
sharetitle: "分享标题",
shareurl: "分享链接",
sharepic: "分享图标",
sharedesc: "分享描述",
successfun: function () {
//分享回调
}
}
引入方式
1.全局引入:在项目的入口文件(main.js)中引入
import wxconfig from 'wxconfig-wyl'
Vue.prototype.$wxconfig = wxconfig
this.$wxconfig({
sharetitle: "分享标题",
shareurl: "分享链接",
sharepic: "分享图标",
sharedesc: "分享描述",
successfun: function () {
//分享回调
}})
2.按需引入:在项目需要分享功能的.vue 文件中引入
import wxconfig from 'wxconfig-wyl'
this.wxconfig({
sharetitle: "分享标题",
shareurl: "分享链接",
sharepic: "分享图标",
sharedesc: "分享描述",
successfun: function () {
//分享回调
}})
1.0.0
3 years ago