Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 这在一个类星体项目和节点模块中无法访问。$q_Vue.js_Quasar Framework_Quasar - Fatal编程技术网

Vue.js 这在一个类星体项目和节点模块中无法访问。$q

Vue.js 这在一个类星体项目和节点模块中无法访问。$q,vue.js,quasar-framework,quasar,Vue.js,Quasar Framework,Quasar,在节点模块中访问Quasar的this.$q并将其用作Quasar CLI中的boot插件时遇到问题 我有一个组件,我在其中启动QLayout,当我在该组件的创建部分放置一个console.log(this.$q)时,我可以访问该组件的信息。但QLayout无法访问相同信息时会出现各种错误 Vue warn]: Error in data(): "TypeError: Cannot read property 'screen' of undefined" found in

在节点模块中访问Quasar的
this.$q
并将其用作Quasar CLI中的
boot
插件时遇到问题

我有一个组件,我在其中启动QLayout,当我在该组件的创建部分放置一个console.log(this.$q)时,我可以访问该组件的信息。但QLayout无法访问相同信息时会出现各种错误

Vue warn]: Error in data(): "TypeError: Cannot read property 'screen' of undefined"

found in

---> <QLayout>
       <DlLayoutMenu> at node_modules/frontend-modules/src/components/system/components/DlLayoutMenu.vue
         <App> at src/App.vue
           <Root>
vue.runtime.esm.js?794d:1888 TypeError: Cannot read property 'screen' of undefined
    at VueComponent.data (QLayout.js?2d21:37)
    at VueComponent.mergedDataFn (vue.runtime.esm.js?794d:1219)
    at getData (vue.runtime.esm.js?794d:4748)
    at initData (vue.runtime.esm.js?794d:4705)
    at initState (vue.runtime.esm.js?794d:4642)
    at VueComponent.Vue._init (vue.runtime.esm.js?794d:5006)
    at new VueComponent (vue.runtime.esm.js?794d:5154)
    at createComponentInstanceForVnode (vue.runtime.esm.js?5593:3283)
    at init (vue.runtime.esm.js?5593:3114)
    at createComponent (vue.runtime.esm.js?5593:5978)
Vue warn]:数据()中的错误:“TypeError:无法读取未定义的属性“screen”
发现于
---> 
在节点_modules/frontend modules/src/components/system/components/DlLayoutMenu.vue
在src/App.vue
vue.runtime.esm.js?794d:1888 TypeError:无法读取未定义的属性“screen”
位于VueComponent.data(QLayout.js?2d21:37)
在VueComponent.mergedDataFn(vue.runtime.esm.js?794d:1219)上
获取数据时(vue.runtime.esm.js?794d:4748)
在initData上(vue.runtime.esm.js?794d:4705)
初始状态(vue.runtime.esm.js?794d:4642)
在VueComponent.Vue._init(Vue.runtime.esm.js?794d:5006)上
在新的VueComponent上(vue.runtime.esm.js?794d:5154)
在createComponentInstanceForVnode(vue.runtime.esm.js?5593:3283)
在初始化时(vue.runtime.esm.js?5593:3114)
在createComponent上(vue.runtime.esm.js?5593:5978)

因此,我在
QLayout.js
中的
35
行上放置了一个调试器,并手动调试此对象的属性,但它完全不同,并且不包含键
$q
我可以修复它,我花了一段时间才理解发生了什么。但我用cli创建了两个Quasar项目。父项目包括quasar和模块。没有指定,实际上也没有在模块中真正使用quasar,它从模块
节点\u模块
获取QLayout。我可以在
QLayout.js
中看到这个硬编码控制台.log
,并调试它实际使用的是哪一个。我真的不知道这是怎么回事。然而,把所有与类星体相关的东西都带到舱外使它工作起来。这有一些缺点,如果我想做一些具体的包内没有它的父母它不会工作