该@drop监听器不会为我工作。它不会调用我告诉它调用的方法。
我想拖动芯片并能够将其放在另一个组件上,并执行一个功能,但是在放下芯片的时候,dropLink方法没有执行,所以我假设@drop事件没有发出。
控制台上不会显示任何错误。
其余事件运行良好,例如@dragstart.
这是我使用的组件的代码:
<template>
<div
@keydown="preventKey"
@drop="dropLink"
>
<template
v-if="!article.isIndex"
>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-chip
small
draggable
class="float-left mt-2"
v-on="on"
@dragstart="dragChipToLinkToAnotherElement"
>
<v-icon x-small>
mdi-vector-link
</v-icon>
</v-chip>
</template>
<span>Link</span>
</v-tooltip>
<v-chip-group
class="mb-n2"
show-arrows
>
<v-chip
v-for="(lk, index) in links"
:key="index"
small
outlined
:class="{'ml-auto': index === 0}"
>
{{ lk.text }}
</v-chip>
</v-chip-group>
</template>
<div
:id="article.id"
spellcheck="false"
@mouseup="mouseUp($event, article)"
v-html="article.con"
/>
</div>
</template>
<script>
export default {
name: …Run Code Online (Sandbox Code Playgroud)