reactjs - gatsby-plugin-transition-link AniLink 无法构建
问题描述
我的 AniLink 转换在我的本地机器上使用gatsby develop和gatsby serve 运行良好。但是使用gatsby build并放在我的服务器上,我只会得到一个没有动画的页面更改。
单击滑块中的图像应该有过渡油漆滴落,但它只会改变页面。
这是一个测试站点http://www.lukedohner.com/bootstrap-ld/react-site/public/
我需要做些什么来为 gatsby 构建引入这个吗?
AniLink from "gatsby-plugin-transition-link/AniLink"
/滑块组件
<AniLink className={`swipermy-slide-link-ani`} paintDrip to="/redemption" duration={1} hex="#ffffff"></AniLink>
/gatsby-config.js
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-plugin-transition-link`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.app/offline
// 'gatsby-plugin-offline',
],
解决方案
我有类似的东西,它只在某些页面上工作。问题出在特定页面 json 404ing 上。
检查您的控制台,如果页面上有任何错误,它可能会阻止处理转换的 js 运行
推荐阅读
- algorithm - 给定边缘列表时如何执行 DFS 或 BFS?
- node.js - 在回调函数中获取推送元素到猫鼬数组
- javascript - 在 React.js 中使用图像而不是单选按钮
- python - 如何将“[4,8,12,16]”传递给 rrule 参数?
- c++ - 测试函数命令行的输出
- sql - 使用表变量/临时表的 SQL 查询 - 性能好
- opengl - 使用 MSVC 将目标文件移动到另一个目录
- wordpress - 按 ACF 关系过滤 WP 查询
- dpdk - 如何使用一个 NIC 设置循环转发以在 DPDK testpmd 中发送数据包并自行接收它们?
- flutter - Dialogflow 版本flutter失败