自定义vue组件中的vuejs v-show调用TypeError:无法读取未定义的属性'_withTask'

问题描述 投票:0回答:1

我制作了一个以下自定义vue组件“editable-image”。

<template>
  <span style="position: relative; text-align: center; color: white; cursor: pointer; margin-right: 10px;" @mouseover="iconShown = true" @mouseleave="iconShown = false" @click="click">
    <img :style="`width: ${width};`" :src="imageUrl"/>
    <v-icon style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" large color="grey" v-show="iconShown">edit</v-icon>
  </span>
</template>

<script>
export default {
props: ['imageUrl', 'width', 'click'],
data() {
    return {
        iconShown: false
    }
}
}
</script>

然后,在我的主要组件中,导入上面的“editable-image”并让鼠标悬停,TypeError:无法读取未定义的属性'_withTask'。

我注意到v-show是问题的主要原因,但尽管经过多次尝试,但尚未解决。

vue.js typeerror
1个回答
0
投票

解决了

问题是点击道具。

在主要组件中,我应该正确输入点击道具!

© www.soinside.com 2019 - 2024. All rights reserved.