0

我正在寻找比这更清洁的方法:

<script>
   import list from '../../../../../../../storage/app/public/json/listofcuisines_en.json';
   export default {}
</script>

如何?

4

1 回答 1

0

你可以使用 webpack 解析webpack.mix.js

mix.webpackConfig({
    resolve: {
       alias: {
           "@": path.resolve(
               __dirname,
               "your_path_to_source_folder"
           )
       }
    }
});

然后在组件中

<script>
   import list from '@/storage/app/public/json/listofcuisines_en.json';
   export default {}
</script>
于 2018-05-17T14:23:04.983 回答