更新记录

0.1(2020-05-21)

1:手绘版 2:笔画粗细 3:笔画颜色 4:背景色 5:撤回 6:保存图片


平台兼容性

手绘版

使用方式

  • 导入

~~~JavaScript

import draw from '@/components/xiaobai-draw.vue'

export default {
    components: {
        draw
    }
}

~~~

  • 使用

~~~HTML

<view class="page">
    <draw ref="ddd" :width="uni.upx2px(750)" :height="uni.upx2px(750)" background="#fff" color="#ff0" :size="size" @onSave="onSave"></draw>
    <button @click="save">Save</button>
    <button @click="init">Init</button>
    <button @click="back">Back</button>
    <image :src="img"></image>
</view>

~~~

~~~JavaScript

import draw from '@/components/xiaobai-draw.vue'

export default {
    components: {
        draw
    },
    methods: {
        init: () => {
            that.$refs.ddd.init()
        },
        back: () => {
            that.$refs.ddd.back()
        },
        save: () => {
            that.$refs.ddd.save()
        },
        onSave: (file) => {
            that.img = file
            console.log(file)
        }
    },
    onLoad() {
        that = this
    },
    data() {
        return {
            size: 6,
            img: ''
        }
    }
}

~~~

  • 属性

width:px 画布大小

heigh:px

background:#fff 画布背景色

color: #000 笔画颜色

size: px 笔画大小

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问