NRWL 故事书与 Angular:替换文档页面

发布于 2025-01-15 12:03:23 字数 687 浏览 3 评论 0原文

我将 NRWL 与 Angular 和故事书一起使用。我想知道是否有任何方法可以用自定义 README.md 文件替换默认的文档页面。

我一直在尝试用 .mdx 文件替换文档页面,但尚未成功。

这就是我尝试从 my-component.stories.ts 文件

export default {
  title: 'MyComponent',
  component: MyComponent,
  decorators: [
    moduleMetadata({
      imports: [
        BrowserModule,
        BrowserAnimationsModule,
        FormsModule,
        MaterialModule
      ],
    })
  ],
  parameters: {
    docs: {
      page: './MyComponent.stories.mdx',
    },
  },  
} as Meta<MyComponent>;

在此处输入图像描述

I am using NRWL with Angular and storybook. I am wondering if there is any way to replace default Docs page with a custom README.md file.

I have been trying to replace Docs page with a .mdx file as well but not successful yet.

This is how i am trying to override default Docs page from within my-component.stories.ts file

export default {
  title: 'MyComponent',
  component: MyComponent,
  decorators: [
    moduleMetadata({
      imports: [
        BrowserModule,
        BrowserAnimationsModule,
        FormsModule,
        MaterialModule
      ],
    })
  ],
  parameters: {
    docs: {
      page: './MyComponent.stories.mdx',
    },
  },  
} as Meta<MyComponent>;

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文