简体   繁体   English

vuetify 的 v-tooltip 破坏了整个页面

[英]v-tooltip from vuetify breaks the whole page

I'm using this example from vuetify documentation我正在使用 vuetify 文档中的这个示例

<v-tooltip bottom>
    <template #activator="data">
        <v-btn color="primary" dark v-on="data.on">Button</v-btn>
    </template>
    <span>Tooltip</span>
</v-tooltip>

but when I put it anywhere my whole page breaks, do not render after that and I got JS error:但是当我把它放在整个页面中断的任何地方时,之后不要渲染,我得到了 JS 错误:

[Vue warn]: Property or method "data" is not defined on the instance but referenced during render. [Vue 警告]:属性或方法“数据”未在实例上定义,但在渲染期间被引用。 Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.通过初始化该属性,确保该属性是反应性的,无论是在数据选项中,还是对于基于类的组件。 See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties .请参阅: https ://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties。 found in ---> at resources/assets/js/components/Project.vue在 ---> 在 resources/assets/js/components/Project.vue 中找到

I'm not sure why, as in the other project it works fine.我不确定为什么,因为在另一个项目中它工作正常。 Any ideas?有任何想法吗?

From Vuetify => activator: When used, will activate the component when clicked (or hover for specific components).来自Vuetify => activator:使用时,将在单击时激活组件(或悬停特定组件)。 This manually stops the event propagation.这会手动停止事件传播。 Without this slot, if you open the component through its model, you will need to manually stop the event propagation如果没有这个槽,如果你通过它的模型打开组件,你将需要手动停止事件传播

"data" can be any string here. “数据”在这里可以是任何字符串。 As long as it matches v-on="data.on" Are you using data property on your page?只要它匹配 v-on="data.on" 您是否在页面上使用数据属性? can you show what you have on your script section?你能在你的脚本部分展示你有什么吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM