wx-f2 icon indicating copy to clipboard operation
wx-f2 copied to clipboard

想将其中的一个图表进一步封装成自己的组件,但是在组件里引入会报错

Open TianJing555 opened this issue 4 years ago • 2 comments

将f2-canvas在组件中引用会报错,如图: image 是不是引用时方法初始化的问题? image 有没有解决方案呀

TianJing555 avatar Apr 03 '20 10:04 TianJing555

内层外层的css加一下。

<view class="container">
<canvas
  type="2d"
  class="f2-canvas"
  bindtouchstart="touchStart"
  bindtouchmove="touchMove"
  bindtouchend="touchEnd"
>
</canvas>
</view>
.f2-canvas {
  width: 100%;
  height: 100%;
}

.container{
  width: 100%;
  height: 500rpx;
}

如果还没用就不知道了

codebear228 avatar Apr 05 '20 13:04 codebear228

直接参考 wx-f2 的封装就就可以了

zengyue avatar Apr 08 '20 02:04 zengyue