export default class VueClass extends Vue {
public ver: number = 123
public testFun (): any {
console.log('testFun', 123456)
}
public onShareAppMessage (options?: any): any {
// let _this = this
let shareObj = {
title: '',
path: '',
imgUrl: '',
success: function (res: any) {
// 转发成功之后的回调
if (res.errMsg === 'shareAppMessage:ok') {
}
},
fail: function (res: any) {
// 转发失败之后的回调
// 用户取消转发
if (res.errMsg === 'shareAppMessage:fail cancel') {
// 转发失败,其中 detail message 为详细失败信息
} else if (res.errMsg === 'shareAppMessage:fail') {
}
}
}
return shareObj
}
}
// 分享 功能无效 this.testFun() 报错 is not a function
export default class Index extends VueClass {
AppUrls = AppUrls
onShow() { // 小程序 hook
// this.testFun()
debug('onShow')
}
mounted() { // vue hook
debug('mounted')
}
}