0.5.2 • Published 4 years ago

@fe-tools/vue-poster v0.5.2

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

vue-poster

易用的海报合成组件

Installation

yarn add @fe-tools/vue-poster

Usage

<template>
  <Poster :width="375" :height="600">
    <PosterImage
      :width="375"
      :height="600"
      :offset-y="0"
      :offset-x="0"
      src="/image/path"
    />

    <PosterText>Poster</PosterText>
  </Poster>
</template>

<script>
import { Poster, PosterImage, PosterText } from '@fe-tools/vue-poster'

export default {
  components: {
    Poster,
    PosterImage,
    PosterText
  }
}
</script>

Components

Poster

AttributeTypeDefaultDescription
widthNumber300宽度
heightNumber300高度
ratioNumber1分辨率
typepng | jpegjpeg生成的图片格式
qualityNumber1生成的图片质量
backgroundColorString--背景色
posterClassString--自定义类名
SlotDescription
default默认插槽,放置海报组件
loading海报渲染时的 Loading 组件
EventCallBackDescription
on-render(base64: String) => void监听海报渲染完成事件

PosterImage

AttributeTypeDefaultDescription
srcString--源文件地址
widthNumber原图宽度宽度
heightNumber原图高度高度
offsetXNumber0水平偏移像素
offsetYNumber0垂直偏移像素
roundBooleanfalse剪切成圆形
corsBooleanfalse是否允许 CORS

PosterQRCode

AttributeTypeDefaultDescription
textString--需要转化成二维码的文本
widthNumber40宽度
heightNumber40高度
offsetXNumber0水平偏移像素
offsetYNumber0垂直偏移像素
marginNumber「点」尺寸的 2二维码白边宽度

PosterText

AttributeTypeDefaultDescription
widthNumberoffsetX 到海报 right 的距离宽度
heightNumberoffsetY 到海报 bottom 的距离高度
offsetXNumber0文本偏移像素
offsetYNumber0文本偏移像素
colorStringblack文字颜色
fontStringnormal 400 14px sans-serif文字样式
lineHeightNumber14行高
textBaselineStringalphabetic基线对齐方式
textOffsetYNumber0文本垂直偏移量
borderBooleanfalse是否显示边框
SlotDescription
default默认插槽,放置需要渲染的文本

PosterTextInline

AttributeTypeDefaultDescription
colorStringextends PosterText color文字颜色
fontStringextends PosterText font文字样式
nowrapBooleanfalse是否不允许换行

PosterLoading

AttributeTypeDefaultDescription
colorString#bdbdbdicon 颜色
backgroundColorStringrgba(0, 0, 0, 0.7)蒙层颜色
0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.4.4

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

5 years ago

0.0.1

5 years ago