小程序生成图片库Painter的Wepy版本
安装
npm install wepy-painter --save
import painter from 'wepy-painter'
例子
<script>
<template lang="wxml" minapp="wepy">
<painter :palette.sync="palette" @imgOK.user="onImgOK" />
</template>
</script>
import wepy from 'wepy'
import painter from 'wepy-painter'
export default class Index extends wepy.page {
components = {
painter
}
data = {
palette: {
{
width: '654rpx',
height: '1000rpx',
background: '#eee'
views: [
{
type: 'text',
text: 'borderWidth',
css: {
bottom: '40rpx',
right: '200rpx',
color: 'green',
borderWidth: '2rpx'
}
}
]
}
}
}
methods = {
onImgOK(e) {
this.imgUrl = e.path
this.$apply()
}
}
}