yueyecheshou1980 2021-08-12 08:50 采纳率: 50%
浏览 112
已结题

谁用过Hanz Writer,我再网页上正常没问题但是在微信小程序里不显示字背景方格也没有

谁用过Hanz Writer,我再网页上正常没问题但是在微信小程序里不显示字背景方格也没有,用鼠标在屏幕应该显示字的区域乱画,控制台console.log输出正常,但就是不显示字,看生成的页面html代码没有生成svg标签
部分代码

onLoad: function (options) {
    this.writerCtx = HanziWriterContext({
      id: 'hz-writer',
      character: '是',
      page: this,
      padding:20,
      strokeColor: '#EE00FF'//偏旁部首颜色
    });

    // You can call any normal HanziWriter method here
    console.log(this.writerCtx);
    //this.writerCtx.showCharacter();
    this.writerCtx.quiz({
      onMistake: function(strokeData) {
        console.log('Oh no! you made a mistake on stroke ' + strokeData.strokeNum);
        console.log("You've made " + strokeData.mistakesOnStroke + " mistakes on this stroke so far");
        console.log("You've made " + strokeData.totalMistakes + " total mistakes on this quiz");
        console.log("There are " + strokeData.strokesRemaining + " strokes remaining in this character");
      },
      onCorrectStroke: function(strokeData) {
        console.log('Yes!!! You got stroke ' + strokeData.strokeNum + ' correct!');
        console.log('You made ' + strokeData.mistakesOnStroke + ' mistakes on this stroke');
        console.log("You've made " + strokeData.totalMistakes + ' total mistakes on this quiz');
        console.log('There are ' + strokeData.strokesRemaining + ' strokes remaining in this character');
      },
      onComplete: function(summaryData) {
        console.log('You did it! You finished drawing ' + summaryData.character);
        console.log('You made ' + summaryData.totalMistakes + ' total mistakes on this quiz');
      }
    });

下面这是生成的页面html代码

img

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 8月20日
    • 创建了问题 8月12日

    悬赏问题

    • ¥15 内存地址视频流转RTMP
    • ¥100 有偿,谁有移远的EC200S固件和最新的Qflsh工具。
    • ¥15 找一个QT页面+目标识别(行人检测)的开源项目
    • ¥15 有没有整苹果智能分拣线上图像数据
    • ¥20 有没有人会这个东西的
    • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
    • ¥30 航迹分离,航迹增强,误差分析
    • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
    • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
    • ¥15 LLM accuracy检测