We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<style lang="less"> .intro { margin: 30px; text-align: center; } button { margin-top: 10px; } </style> `
<style lang="less"> .intro { margin: 30px; text-align: center; } button { margin-top: 10px; } </style>
<view class="page"> <view class="intro">欢迎使用代码片段,可在控制台查看代码片段的说明和文档</view> <view style="text-align: center;"> <canvas id="c1" type="2d" style="display: inline-block; width: 300px; height: 300px;"></canvas> <button bindtap="init" style="width: 300px;">init</button> <button bindtap="play" style="width: 300px;">play</button> <button bindtap="pause" style="width: 300px;">pause</button> </view> </view>
`
` import wepy from 'wepy' import lottie from '../utils/lottie'
export default class LongList extends wepy.page { data = { } components = { }
methods= { init() { if (this._inited) { return } wx.createSelectorQuery().selectAll('#c1').node(res => { const canvas = res[0].node const context = canvas.getContext('2d') canvas.width = 300 canvas.height = 300 lottie.setup(canvas) this.ani = lottie.loadAnimation({ loop: true, autoplay: false, animationData: require('../utils/catrim.js'), // path: 'https://whaletest.21kunpeng.com/static_pages/js', rendererSettings: { context } }) this._inited = true }).exec() }, play() { this.ani.play() }, pause() { this.ani.pause() } } onLoad(options) { } onShow () { console.log('test.onShow') } onUnload() { }
} ` 界面显示都正常,插件、资源都在utils文件夹下引用也正常,就是canvas报错渲染不出来
The text was updated successfully, but these errors were encountered:
小程序 canvas 接口还不支持真机调试,你试下直接预览可以不?
Sorry, something went wrong.
直接预览没有问题~不支持真机调试,那写完的功能,发布之后在真机上可以直接使用?
可以先直接预览确认有没有问题,预览没问题发布也就没问题
No branches or pull requests
<style lang="less"> .intro { margin: 30px; text-align: center; } button { margin-top: 10px; } </style>
`
`
`
import wepy from 'wepy'
import lottie from '../utils/lottie'
export default class LongList extends wepy.page {
data = {
}
components = {
}
}
`
界面显示都正常,插件、资源都在utils文件夹下引用也正常,就是canvas报错渲染不出来
The text was updated successfully, but these errors were encountered: