组件:canvas
微信版本:8.0.50
基础库:3.5.0
uniapp 构建
开发者工具正常。真机会报 [Component] <canvas>: canvas-id xxx in this page has already existed
画布id,例如:chart_4GG5X1NS0nBwwABLob,随机生成的字符串
代码片段结构:
<scroll-view scroll-y="true">
<view class="p20 bg-white mt10" v-if="scope.id">
<personal-pie-chart :scope="scope" @openTask="openTask"></personal-pie-chart>
</view>
<view class="p20 bg-white mt10" v-if="scope.id">
<month-budget-pie-chart :scope="scope"></month-budget-pie-chart>
</view>
</scroll-view>
组件内:
<canvas :id="canvasId" :canvasId="canvasId"></canvas>
试试改成下面这样:id和canvas-id不要同时存在