1.0.2 • Published 2 years ago

@mas.io/adc-painter v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

tnpm install --save @alipay/adc-painter

组件介绍

行业小程序生成海报组件,针对支付宝行业的各个不同场景进行定制化开发,满足业务需求。

参数说明

属性必填参数类型参数说明默认值示例
customStyleObject自定义样式nullnull
paletteObject数据源{}{ "width": "100px", "views": {"type": "text", "text": "张三", "css": {"color": "#fff"}}}
viewsArraypalette内部属性[]{"type": "text", "text": "张三", "css": {"color": "#fff"}}
typeStringviews内部属性, text: 文本, qrcode: 二维码, image: 图片""text
textStringviews内部属性, 当type为text时生效渲染的文本内容""张三
contentStringviews内部属性, 当type为qrcode时生效二维码的内容""张三
imageStringviews内部属性, 当type为image时生效图片url地址""'http://xxxxxx'
cssObjectviews内部属性{}{"color": "#fff", fontSize: "12px"}
onSuccessFunction海报生成成功时返回null() => {}
onErrorFunction海报生成失败时返回null() => {}

在小程序中使用

{
  "usingComponents": {
    "mas-adc-painter": "@alipay/adc-painter/es/index"
  }
}

在 page.axml 中引用组件

<!-- 页面使用方式 -->
 <mas-adc-painter
 palette="{{ palette }}"
 onSuccess="onSuccess"
 onError="onError"
/>

Badges

TNPM version TNPM downloads