
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
jt-med-plugin
Advanced tools
npm i jt-med-plugin
// 引入
import jt from 'jt-med-plugin'
Vue.use(jt) //此时引入后会注册一个全局的`$jt`命名空间,可以使用`this.$jt.capture()`方法来截图
//在组件中可直接使用this.$jt.capture方法来使用
单独引入
import { capture } from 'jt-med-plugin'
说明
该插件会在 vue 的原型定义一个$jt属性,携带一些常用方法。
方法
截取目标 dom 并且转成文件对象,方便进行上传。
参数 {target:HTMLElement,name?:string,quality?:number,type?:string} 参数是个对象
返回 Promise<File> 内容是文件对象的 promise 对象。
示例:
<template>
<div class="test">
<button @click="screenshot">截图</button>
</div>
</template>
<script>
methds:{
async screenshot(){
let imgUrl = asait this.$jt.capture({target:document.body})
let file = await this.$jt.getImageFile({target:document.body,name:'jt-med.png'})
}
}
</script>
jt-sign该组件是一个在一个区域内实现触屏画画的功能,可用于签名等功能。
使用组件需要引入样式,如示:
import 'jt-med-plugin/pro_dist/jt.css'
import jt from 'jt-med-plugin'
Vue.use(jt)
使用
<div class='sign-container' style='height:500px;width:500px;>
<jt-sign ref='sign'/>
</div>
插件会全局自动注册jt-sign组件,然后需要在页面该组件的外面添加一个容器,设置宽高。
也可以直接在该组件上设置样式宽高。

组件 props
rgba(255,255,250,1).组件属性:
组件方法:
async setImg(){
this.imgurl = await this.$sign.getImage()
}
async getFile(){
return await this.$sign.getFile('med-sign.png')
}
示例
const sign = this.$refs.sign
sign.clear()
back():void 清除最新的笔画
initBg():vlid 初始化画布背景
FAQs
```cmd npm i jt-med-plugin
The npm package jt-med-plugin receives a total of 11 weekly downloads. As such, jt-med-plugin popularity was classified as not popular.
We found that jt-med-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.