uniapp - 右上角分享

onLoad同级,有图片就用图片,没图片就直接用屏幕截图

    onShareAppMessage() {
        let that = this;
        let pages = getCurrentPages();
        let route = pages[pages.length - 1].$page.fullPath;
        let imageUrl = that.shareUrl || '';
        if (imageUrl != '') {
            return {
                title: 'XXX',
                path: route,
                imageUrl: imageUrl,
            };
        } else {
            return {
                title: 'XXX',
                path: route,
            };
        }
    },
上一篇:箫声远(本人)的小站(为展示作品、简历,基于github pages)


下一篇:uni-app基础