【发布时间】:2019-03-20 19:28:25
【问题描述】:
我正在尝试按照他们文档中的示例实施v-tooltip,但我无法使其工作。如果我复制示例,我会收到此错误:
[Vue warn]: Property or method "on" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
如果我声明属性on,btn 根本不会出现。
这是模板:
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn color="primary" dark v-on="on">Bottom</v-btn>
</template>
<span>Bottom tooltip</span>
</v-tooltip>
【问题讨论】:
-
stackoverflow.com/questions/49079936/… 也许这会有所帮助?
-
激活器表示“on”,即鼠标悬停在组件上的位置(可以将其更改为属性,以便以编程方式激活它)。我真的不明白为什么单花括号。
-
你用的是什么版本的vue? 2.6 之前的版本不支持
v-slot -
"vue": "^2.5.17",这可能是问题@thanksd
标签: vue.js vuetify.js