我有一个vue-konva的问题,我不能在同一层中创建太多的形状,例如:
<template>
<v-stage :config = "stage">
<v-layer>
<v-circle :config = "circle1"
/>
</v-layer>
<v-layer>
<v-circle :config = "circle2"
/>
</v-layer>
</v-stage>
</template>
在结果中,我得到了第一个形状和错误:
vue.common.dev.js:630 [Vue warn]: Error in mounted hook: "TypeError: parentKonvaNode.add is not a function"
found in
---> <VArrow>
<VCircle>... (1 recursive calls)
<VLayer>
<Edge>
<VStage>
<Anonymous>
<Root>
发布于 2020-04-27 15:35:38
vue-konva
中没有layer
组件。您必须使用v-layer
<v-stage :config = "stage">
<v-layer>
<v-circle :config = "{radius: 10, fill: 'blue'}"/>
</v-layer>
<v-layer>
<v-circle :config = "{radius: 10, fill: 'blue'}"/>
</v-layer>
</v-stage>
发布于 2020-04-28 11:44:39
是我的错,它是v-layer,当我在这里重写它的时候是一个错误,对不起。我使用了v-layer,它没有得到预期的结果,它只显示了第一个形状,并得到了错误。
https://stackoverflow.com/questions/61428370
复制