hanzi-writer-miniprogram 按照官方文档指引的代码实现,无法正确看到演示?
// index.js
// 获取应用实例
import createHanziWriterContext from 'hanzi-writer-miniprogram';
Page({
onLoad: function() {
this.writerCtx = createHanziWriterContext({
id: 'hz-writer',
character: '人',
page: this,
});
// You can call any normal HanziWriter method here
this.writerCtx.loopCharacterAnimation();
}
});
<!--index.wxml-->
<view class="container">
<hanzi-writer-view id="hz-writer" width="300" height="300" />
</view>
// app.json
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle":"black"
},
"usingComponents": {
"hanzi-writer-view": "hanzi-writer-miniprogram/hanzi-writer-view"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
按照上述三个文件标签演示的效果,并没有看到动画正常渲染,console输出看起来都是正常的 [图片] 调试基础库版本:2.30.4