sufu
sufu
  • 发布:2021-11-10 14:27
  • 更新:2021-11-15 15:03
  • 阅读:567

使用 composition api 调用子组件方法报错

分类:uni-app
<template>  
  <view v-if="isDisplayRecords">  
    <Records ref="refRecords" />  
  </view>  
  <view v-if="isDisplayToolset">  
    <Toolset />  
  </view>  
  <view v-if="isDisplayMessage">  
    <Message />  
  </view>  
  <view v-if="isDisplayMine">  
    <Mine />  
  </view>  
</template>

使用 composition-api ref 调用子组件方法,在切换组件时报错,错误如下
[Vue warn]: Property or method "toJSON" 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.

2021-11-10 14:27 负责人:无 分享
已邀请:
sufu

sufu (作者)

ddddddd

该问题目前已经被锁定, 无法添加新回复