(Codesandbox,Vue)“属性或方法“children”未在实例上定义,但在渲染期间引用。”

2024-02-05

我目前正在构建一个状态管理器,它可以集成到多个前端框架中,包括 Vue。 为了演示 Vue 中状态管理器的用法,我创建了一个简单的codesandbox。 因为有一个实时代码示例总是很好,可以在自述文件中进行推广。 但不知何故,我总是在代码和框中收到此错误(见下文)。

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

上面的错误only出现在显示的codesandbox中editor + preview。 在本地或在单独的选项卡中(仅显示preview) 它按预期工作(没有错误)。

代码沙箱(错误):
https://codesandbox.io/s/agilets-first-state-i5xxs?file=/src/main.js https://codesandbox.io/s/agilets-first-state-i5xxs?file=/src/main.js

Codesandbox 单独点击预览(无错误):
https://i5xxs.csb.app/ https://i5xxs.csb.app/

本地项目(无错误):
https://github.com/agile-ts/agile/tree/master/examples/vue/develop/my-project https://github.com/agile-ts/agile/tree/master/examples/vue/develop/my-project

我不知道我做错了什么。 但这和我的State Manager有关系, 由于默认vue 代码沙盒 https://codesandbox.io/s/vue工作正常。


忽略该错误。这是一个Codesandbox 中的错误 https://github.com/codesandbox/codesandbox-client/issues/2095#issuecomment-510655208而不是由您自己的代码直接引起的。他们的其中之一开发者4月13日评论 https://github.com/codesandbox/codesandbox-client/issues/2095#issuecomment-818500869该问题的优先级较低,因此可能不会很快得到解决。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

(Codesandbox,Vue)“属性或方法“children”未在实例上定义,但在渲染期间引用。” 的相关文章