无法绑定 v-on:单击 Vuetify [Vue 警告]:v-on 处理程序中的错误:“TypeError:handler.apply 不是函数" [英] Can't bind v-on:click on Vuetify [Vue warn]: Error in v-on handler: "TypeError: handler.apply is not a function"

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

问题描述

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

I am trying to bind a click event on dynamically generated subheader v-list-tile Vuetify https://vuetifyjs.com/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆