在Gridsome中加载Lottie JSON文件

问题描述

我尝试在Gridsome中使用lottie-vuejs,但未能成功导入存储在 src / assets / animations / success.json 中的动画文件。我收到404错误

在我的模板中,我像这样使用彩票:

<template>
 </Layout>
  <lottie-animation path="./assets/animations/success.json" />
 </Layout>
</template>

在我的网格文件中,我尝试使用Webpack导入文件,但是仍然无法正常工作。

const path = require('path');

module.exports = {

 configureWebpack: {
  module: {
   rules: [
     {
       type: 'javascript/auto',test: /\.json$/,include: [path.resolve(__dirname,'src/assets/animations')],use: [
         {
           loader: 'file-loader',},],

有什么想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)