跳到内容
SCRM DOC
创建于2024-09-29更新于 2025-03-22

02. SDK 使用

封装了一些微信常用的 js-sdk 操作。

0.2.1 配置页面是否需要开启授权

参数类型默认值
requiresAuthbooleanfalse
  {
    path: '/home',
    name: 'home',
    component: () => import('/@/views/home/index.vue'),
    meta: {
      title: '首页',
      keepAlive: false,
      requiresAuth: true, // 是否需要授权
    },
  },

0.2.3 自动分享配置参数

shareInfo

参数类型说明
isShareboolean是否开启自动分享配置参数
shareTitlestring分享的标题
imgUrlstring分享的卡片图片
descstring分享的描述
  {
    path: '/shareAuto',
    name: 'shareAuto',
    component: () => import('/src/views/shareAuto/ShareAuto.vue'),
    meta: {
      title: '',
      shareInfo: {
        isShare: true,
        shareTitle: '',
        imgUrl: '',
        desc: '',
      },
    },
  },

0.2.4 手动分享配置参数

  import { useWxSDK } from '/@/hooks/useWxSDK';
  import { useWxShare } from '/@/hooks/useWxShare';

  const { initConfig } = useWxSDK();
  
  initConfig().then(() => {
    useWxShare({
        title: '',
        desc: '',
        imgUrl: '',
    });
  });
  1. 啥是自动配置,是不是说,整个页面固定分享参数,而手动分享是说根据业务需要自行指定。

反向链接 · 1

本页目录