如何给左侧菜单排序

来源:8-10 完成的 storybook 的架构,给剩下的组件添加 stories

ku咖啡不加糖

2020-04-06

图片描述

如何让welcome页面菜单排在第一个,button菜单排在第二个???

写回答

1回答

张轩

2020-04-07

同学你好 在 5.2.8 中可以在 config.tsx 中给它手动排序,你可以看develop 分支的代码,类似这样

const loaderFn = () => {
    return [
        require('../src/welcome.stories.tsx'),
        require('../src/components/Button/button.stories.tsx'),
        require('../src/components/Alert/alert.stories.tsx'),
        ...等等很多
    ]
}


// automatically import all files ending in *.stories.js
configure(loaderFn, module);


0
1
ku咖啡不加糖
master和develop分支上的方式都试了,没起作用。是不是新版storybook换了别的方式手动排序?
2020-04-08
共1条回复

React18+TS高仿AntD从零到一打造组件库

设计,开发,测试,发布再到 CI/CD,从0到1造轮子

2124 学习 · 959 问题

查看课程