ding-helper

1.0.5 • Public • Published

使用说明

1、插件安装

npm install ding-helper --save

2、插件引入方式

1、main.js 引入 dinghelper
import 自定义名称 from '插件名称'
2、Vue.use('自定义名称')
3、在需要使用的界面中直接使用该插件(如果需要插件的UI界面)
<ding-helper></ding-helper>

3、插件可传属性

属性名称 type default
list array [{imgUrl: '', href: '/', text: ''}] 功能列表
示例:
list: [{imgUrl: require('../static/tocreate.png'), href: '/index', text: '测试'}]
imgUrl: 必须使用require 方式引入图片地址(重要)
href: 跳转到的路由界面 (界面地址必须要注册,不能使用没有注册的路由地址)
text: 功能描述 如:’手动录入‘,’信息填写‘
url string '' 应用的头部图片地址
示例:
require('../static/banner.jpg') 必须使用require 方式引入图片地址(重要)

4、插件方法

引入插件之后可以在vue文件中使用如下几个方法

1、this.$isDingPlatForm()	// 判断当下的运行环境是不是钉钉环境 return: true: 是, false: 否

2、this.$setTitle(title)	// 设置标题, title(string): 标题栏标题文字

3、this.$getCode(corpid)	// 获取免登授权码	corpid 企业ID return{status: true/false,data: code/errMessage}, status: 获取成功为true,获取失败为false; data: 获取成功为授权码,失败为失败信息

4、this.$ddConfig(config)	//JSAPI鉴权,鉴权失败会弹出失败信息;
config 格式为: { agentId: String, corpId: String, timeStamp: timeStamp, nonceStr: String, signature: String, jsApiList: Array}
agentId // 必填,微应用ID
corpId // 必填,企业ID
timeStamp // 必填,生成签名的时间戳
nonceStr // 必填,自定义固定字符串。
signature // 必填,签名
jsApiList // JSAPI鉴权列表 具体鉴权api请参考钉钉开发文档

Readme

Keywords

none

Package Sidebar

Install

npm i ding-helper

Weekly Downloads

4

Version

1.0.5

License

ISC

Unpacked Size

2.45 MB

Total Files

10

Last publish

Collaborators

  • shadoudoushidai