无法绑定 v

编程入门 行业动态 更新时间:2024-10-24 20:16:16
本文介绍了无法绑定 v-on:单击 Vuetify [Vue 警告]:v-on 处理程序中的错误:“TypeError:handler.apply 不是函数"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试在动态生成的子标题 v-list-tile Vuetify https://上绑定点击事件vuetifyjs/en/components/subheaders 但每次我点击该选项时都会出现错误.

I am trying to bind a click event on dynamically generated subheader v-list-tile Vuetify https://vuetifyjs/en/components/subheaders but each time I click the option an error appears.

vue.js:634 [Vue warn]: Error in v-on handler: "TypeError: handler.apply is not a function"

found in

---> <VListTile>
       <VList>
         <VCard>
           <VApp>
             <Root>

我尝试强行添加方法(不传递对象)并且它有效.它只是在传递给对象并动态呈现时触发.

I have tried adding the methods forcibly (without passing object) and it works. It just triggers when it is passed to an object and dynamically rendered.

这是我遇到的错误的Codepen.

我期望的是触发调用的方法而不触发错误

What I am expecting is to trigger the method that is called without triggering an error

推荐答案

我的方法在 Data 对象中.它们应该处于同一级别.

My methods are inside the Data object. They should be at the same level.

在 Codepen 示例中,从数据对象中取出函数名,只留下号码 id.

In the Codepen example take the function name out of the data object and only left the number id.

通过在 @click 事件上调用函数并在那里传递数字使该方法起作用.

By calling the function on the @click event and passing the number there made the method work.

这篇关于无法绑定 v-on:单击 Vuetify [Vue 警告]:v-on 处理程序中的错误:“TypeError:handler.apply 不是函数"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 00:54:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1144997.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!