<template>
<view>
{{text}}
<button type="primary" @click="click">分享</button>
</view>
</template>
<script>
export default {
data() {
return {
text: '兼容'
}
},
components: {},
methods: {
// #ifdef APP-PLUS
click() {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 1,
summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
},
// #endif
// #ifdef MP-WEIXIN
click() {
console.log('分享')
}
// #endif
},
onShareAppMessage() {
return {
title: 'hello'
}
}
}
</script>
</style>