coopwire-plugin-screenshot2
v0.1.30
Published
为 Logwire 和 Coopwire 开发的全局反馈插件
Downloads
9
Readme
coopwire-plugin-screenshot
为 Logwire 和 Coopwire 开发的全局反馈插件
Usage
通过 webpack 使用
npm install coopwire-plugin-screenshot --save
代码
// main.js
import Screenshot from 'coopwire-plugin-screenshot'
Vue.use(Screenshot, options) // 此时注册了一个名称为 toolbar 的组件到系统内
// App.vue
<template>
<toolbar>
</template>
参数内容
Options 参数内容
|参数名称|类型|说明| |-|-|-| |ElementUI|-|Element UI框架,为了节约打包空间,框架使用系统引入的,在项目内通过 import 引入 ElementUI 后,还需要在此处传递给插件| |Axios|-|Axios 实例,可以是 axios 框架导出的内容,也可以是系统内对 axios 实例定制化后的实例,保持和系统内接口调用的 axios 一致| |getProjectInformation|InformationOptions|获取项目信息参数|
InformationOptions 参数内容
|参数名称|类型|说明|
|-|-|-|
|getProjectId|Function|如何获取当前打开的的项目ID,创建成功后反馈将出现在此项目内,不设置则返回空字符串|
|getProjectName|Function|如何获取当前打开的项目名称, 请做好异常处理,不设置则返回空字符串|
|getRequestRoot|Function|如何获取请求根路径,在 Logwire 中使用时,请求地址是 Coopwire 接口地址,需要更改根路径,不设置则返回空字符串|
|getUserEmail|Function|如何获取当前用户邮箱,不设置则返回空字符串|
|checkHelp|Function|点击帮助
按钮时触发逻辑,不同系统内可以跳转不同地址|
所有方法内 this 参数都可以获取到当前系统的 $store, $router 等内容,因为方法最终调用时会作为混入内容处理,所以
请不要写箭头函数
更新
代码会提交到 gitlab 仓库, 开发者可以下载后更改其中内容
然后执行下列命令
npm version 命令创建一个新的版本号
npm run build 根据当前版本号打包内容
在使用插件的地方进行版本号的更新