JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q43155F
  • License MIT

hover按钮预览二维码

Package Exports

  • @gdyfe/btn-qrcode

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gdyfe/btn-qrcode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@gdyfe/btn-qrcode

Installation

yarn add @gdyfe/btn-qrcode

or

npm install --save @gdyfe/btn-qrcode

Usage

import '@gdyfe/btn-qrcode'
or
import '@gdyfe/btn-qrcode/dist/btnqrcode.js'
<html>
  <body>
    <div id="btn-qrcode"></div>
  </body>
</html>
const btn = new  new BtnQRCode('btn-qrcode', options)
btn.init()

Options

属性 说明 类型 必填 默认值
url 需转成二维码的url string -
btnText 按钮显示文字 string 预览
text 二维码下方文字链接 array ' '

Demo

const btn = new BtnQRCode('btn-qrcode', {
  url: 'https://www.baidu.com',
  btnText: '预览',
  text: [
    ['打开', 'https://www.baidu.com'],
    ['链接', 'https://www.baidu.com'],
  ],
})
btn.init()