快应用中调用分享,一次集成,享受多个平台
参考官方资料:https://github.com/quickappcn/sample/blob/master/src/interface/system/share/index.ux
<script>
import share from '@system.share'
import media from '@system.media'
import file from '@system.file'
import prompt from '@system.prompt'
export default {
private: {
componentName: 'share',
},
onInit() {
this.$page.setTitleBar({text: 'Share'})
},
shareText () {
share.share({
type: 'text/html',
data: '分享内容传到这里',
success: function () {
console.info('share success')
},
fail: function (erromsg, errocode) {
prompt.showToast({
message: `${errocode}: ${erromsg}`
})
}
})
},
</script>
<style>