Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/412.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
Javascript vue\uuu网页包\u导入的\u模块\u 1\uuu。默认值不是构造函数_Javascript_Vue.js_Webpack - Fatal编程技术网

Javascript vue\uuu网页包\u导入的\u模块\u 1\uuu。默认值不是构造函数

Javascript vue\uuu网页包\u导入的\u模块\u 1\uuu。默认值不是构造函数,javascript,vue.js,webpack,Javascript,Vue.js,Webpack,我已经在一个vue页面中使用了一个现有的vue组件。我已将其添加到新组件中。它可以工作,但我注意到Chrome控制台中有奇怪的错误。它们不会出现在它最初出现的地方。我不知道为什么会发生这种情况,因为我从第一次使用中复制了相关代码 Date.vue: <template> <span>{{ this.formatted }}</span> </template> <script> import { show } from '@/ut

我已经在一个vue页面中使用了一个现有的vue组件。我已将其添加到新组件中。它可以工作,但我注意到Chrome控制台中有奇怪的错误。它们不会出现在它最初出现的地方。我不知道为什么会发生这种情况,因为我从第一次使用中复制了相关代码

Date.vue:

<template>
  <span>{{ this.formatted }}</span>
</template>

<script>
import { show } from '@/utils/dateUtils';

export default {
  name: 'Date',
  props: {
    date: String,
    format: String,
  },
  computed: {
    formatted() {
      return show(this.date, this.format);
    },
  },
};
</script>

{{this.formatted}}
从'@/utils/dateUtils'导入{show};
导出默认值{
姓名:'日期',
道具:{
日期:String,
格式:字符串,
},
计算:{
格式化的(){
返回显示(this.date,this.format);
},
},
};
新的组成部分:

<template>
  <Date :date="item.info.date" format="dynamicDate" /> &bull;
</template>

<script>
import Date from '@/components/atoms/Date.vue';
import ProfileLink from '@/components/atoms/ProfileLink.vue';

export default {
  name: 'ItemBox',
  components: {
    Date,
  },

&公牛;
从“@/components/atoms/Date.vue”导入日期;
从“@/components/atoms/ProfileLink.vue”导入ProfileLink;
导出默认值{
名称:'ItemBox',
组成部分:{
日期,
},
错误:

vue.runtime.esm.js:619 [Vue warn]: Error in created hook: "TypeError: _components_atoms_Date_vue__WEBPACK_IMPORTED_MODULE_1__.default is not a constructor"

found in

---> <ItemBox> at src/components/molecules/ItemBox.vue
   <GridLayout>
     <ItemList> at src/components/molecules/ItemList.vue
       <Home> at src/views/Home.vue
         <App> at src/App.vue
           <Root>
warn @ vue.runtime.esm.js:619
logError @ vue.runtime.esm.js:1884
globalHandleError @ vue.runtime.esm.js:1879
handleError @ vue.runtime.esm.js:1839
Vue._init @ vue.runtime.esm.js:5008
VueComponent @ vue.runtime.esm.js:5154
createComponentInstanceForVnode @ vue.runtime.esm.js:3283
./src/main.js @ main.js:78
__webpack_require__ @ bootstrap:853
fn @ bootstrap:150
1 @ Home.vue?1405:1
__webpack_require__ @ bootstrap:853
vue.runtime.esm.js:1888 TypeError: _components_atoms_Date_vue__WEBPACK_IMPORTED_MODULE_1__.default is not a constructor
at VueComponent.created (ItemBox.vue:63)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at callHook (vue.runtime.esm.js:4219)
at VueComponent.Vue._init (vue.runtime.esm.js:5008)
at new VueComponent (vue.runtime.esm.js:5154)
vue.runtime.esm.js:619[vue warn]:创建的挂钩中出现错误:“TypeError:\u组件\u原子\u日期\u vue\u网页包\u导入的模块\u 1\u。默认值不是构造函数”
发现于
--->在src/components/molecules/ItemBox.vue处
在src/components/molecules/ItemList.vue
在src/views/Home.vue
在src/App.vue
warn@vue.runtime.esm.js:619
logError@vue.runtime.esm.js:1884
globalHandleError@vue.runtime.esm.js:1879
handleError@vue.runtime.esm.js:1839
Vue._init@Vue.runtime.esm.js:5008
VueComponent@vue.runtime.esm.js:5154
createComponentInstanceForVnode@vue.runtime.esm.js:3283
/src/main.js@main.js:78
__webpack_require_uu_@bootstrap:853
fn@bootstrap:150
1@Home.vue?1405:1
__webpack_require_uu_@bootstrap:853
vue.runtime.esm.js:1888 TypeError:_组件_原子_日期_vue _网页_导入_模块_1 _。默认值不是构造函数
在VueComponent.created处(ItemBox.vue:63)
调用错误处理时(vue.runtime.esm.js:1854)
在callHook上(vue.runtime.esm.js:4219)
在VueComponent.Vue._init(Vue.runtime.esm.js:5008)上
在新的VueComponent上(vue.runtime.esm.js:5154)

我也有同样的错误,你找到解决方案了吗?很长时间。我想我更换了使用此代码的组件。可能。我有同样的错误,你找到解决方案了吗?很长时间。我想我更换了使用此代码的组件。可能。