Teo*_*oTN 6 javascript gatsby storybook
我正在尝试用 Gatsby 的组件为我的组件编写一本故事书StaticImage,但这最终什么也没有呈现,并且在控制台中伪装成警告的错误:
Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78
(anonymous) @ static-image.server.tsx:52
Run Code Online (Sandbox Code Playgroud)
我想知道是否有办法StaticImage在 Gatsby 之外使用渲染组件?
组件很简单:
import React from 'react';
import { StaticImage } from 'gatsby-plugin-image';
export const Card = ({ title }) => {
return (
<div>
<div>{title}</div>
<StaticImage src="../../assets/images/background.png" alt="" width={300} height={100}/>
</div>
);
};
Run Code Online (Sandbox Code Playgroud)
我正在使用 Gatsby v3 和 Storybook v6.3
| 归档时间: |
|
| 查看次数: |
1078 次 |
| 最近记录: |