模块构建失败:SyntaxError当我在Laravel + React中尝试asyncComponent时

时间:2018-12-07 12:07:42

标签: reactjs laravel react-laravel

我想在laravel + react中实现asyncComponent。在尝试asyncComponent之前,一切正常。

当我尝试返回错误时:

代码:

import asyncComponent from '../component/asyncComponent';

const Home = asyncComponent(() => import('../pages/home') //line 9
  .then(module => module.default), { name: 'Home' });

错误:

  

模块构建失败:SyntaxError:   E:/xampp/htdocs/react/lara-react/blog-new/resources/js/back-end/layout/main.js:   意外令牌(9:34)

如何在laravel中实现asyncComponent?

0 个答案:

没有答案