@yll10243/lowcode-generate-img
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

通过canvans生成指定大小图片的base64

按照及其使用

# 按照包
npm i @yll10243/lowcode-generate-img 
# 在main.ts中
import drawImg from "@yll10243/lowcode-generate-img"
const app = createApp(App)
app.use(drawImg)
# 组件中使用
<LowImage :width="w" :height="h"></LowImage>

参数及使用

参数

const props = defineProps({
  /**
   * 宽度
   */
  width: {
    type: Number,
    default: "0"
  },
  /**
   * 高度
   */
  height: {
    type: Number,
    default: "0"
  },
  /**
   * 背景色 red|#ffffff
   */
  bgColor: {
    type: String,
    default: ""
  },
  /**
   * 圆角
   */
  around: {
    type: Number,
    default: 0
  },
  /**
   * 文字颜色red|#ffffff 默认黑色
   */
  textColor: {
    type: String,
    default: "#000000"
  }
})

使用

<drawImg ref="xxx" :width="w" :height="h" :bgColor="bg" :textColor="tg" :around="r" />
生成图片
let res = xxx.value.generateImg()

/@yll10243/lowcode-generate-img/

    Package Sidebar

    Install

    npm i @yll10243/lowcode-generate-img

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    15.4 kB

    Total Files

    6

    Last publish

    Collaborators

    • yll10243