微信2016 v6.3.23正式版人气:464919
下载
微信2015 v6.3.16.64 官方正式版人气:108017
下载
微信小程序推出以来一直比较受大家欢迎,微信小程序中有一个功能是canvas画布功能,那么这个功能该怎么用呢?下面的教程就是关于微信小程序的canvas画布功能怎么用的,一起来看看吧。
canvas画布,你可以理解为有一张白布,你可以在画布上画出不同形状、颜色、粗细的图形。
组件用法:
wxml
<canvas class="canvas1" canvas-id="canvas1" bindtouchstart="mytouchstart" bindtouchmove="mytouchmove" bindtouchend="mytouchend"></canvas>
复制代码
js
Page({
...
mytouchstart: function(e){
console.log('touchstart')
},
mytouchmove: function(e){
console.log('touchmove')
},
mytouchend: function(e){
console.log('touchend')
}
...
})
复制代码
wxss
.canvas1{
background-color: #E0E0E0;
}
复制代码
今天的内容就和大家介绍到这里了,想要了解更多精彩内容请继续关注澳门银河网上开户每日更新!小编等着你哦!
标签: