Skip to content

整合dom-to-image及html2canvas,开箱即用的dom截图组件

License

Notifications You must be signed in to change notification settings

Sweet-KK/dom-screenshot

Repository files navigation

dom-screenshot

NPM Version PRs Welcome

Table of Contents

Introduction

整合dom-to-image及html2canvas,开箱即用的dom截图组件。

⬆ Back to Top

Features

  • 整合dom-to-image及html2canvas,解决图片模糊,不加载等问题
  • 判断设备类型使用合适的方法,减少遇到兼容性问题无法运行而造成困扰,也可传入useHtml2canvas去自主控制

⬆ Back to Top

Install

npm install @kk306484328/dom-screenshot

⬆ Back to Top

Usage

<template>
  <div class="demo">
    <dom-screenshot is-save ref="shotDom">
      <h1>Hellow word!</h1>
    </dom-screenshot>

    <button @click="onClick">截图-shot</button>
  </div>
</template>

<script>
import DomScreenshot from '@kk306484328/dom-screenshot'
export default {
  components: { DomScreenshot },
  methods: {
    onClick () {
      this.$refs.shotDom.shot()
    }
  }
}
</script>

⬆ Back to Top

doc

⬆ Back to Top

License

MIT

⬆ Back to Top

About

整合dom-to-image及html2canvas,开箱即用的dom截图组件

Resources

License

Stars

Watchers

Forks

Packages

No packages published