[vue warn]: property or method “look“ is not defined on the instance but referenced during render. m

今天写代码的时候遇到这个问题:(他说在这个vue里面找不到我调用的look方法)

一。错误:

BpRecordList.vue:86  [Vue warn]: Property or method "look" 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. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---> <BpRecordList>
       <Anonymous>
         <ALayoutContent>
           <Anonymous>
             <ALayout>
               <Anonymous>
                 <ALayout>
                   <GlobalLayout> at src/components/page/GlobalLayout.vue
                     <TabLayout> at src/components/layouts/TabLayout.vue
                       <ALocaleProvider>
                         <LocaleReceiver>
                           <AConfigProvider>
                             <App> at src/App.vue
                               <Root>

二。解决方法

如果你确定自己是有调用的这个方法(我这个里面就是指look方法)(我明明定义了look方法,但是报错说没有)的时候,并且你十分确信自己的代码没有错,你可以去看一下自己代码的结构,去看看look方法到底有没有写在<script>标签里面(vue3),或者在没在methods标签里面(vue2),我找了很久错之后看了一下我的代码结构,我发现我的look方法写在了methods标签的外面,所以vue找不到我的look方法,然后报错了。

改正:只需要把look方法挪进methods标签里面就ok了。

谢谢大家可以看到这里,有问题可以私信我~~

  • 9
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值