我创建了一个指令,我需要使该指令调用一个存在于具有该指令的组件中的函数。
// Component with directive, this component has the method 'setDisabled()'
<v-button v-can:edit.disable="[something]" @click="add" />
// Directive created
const can = {
mounted: async (el, binding, vnode) => {
let ha