我正在使用 NextJS 和样式组件。阅读下面的文档,我在 NextJS 中添加了一个自定义 _document.js 以使样式组件正常工作。
示例代码是用 React 类编写的,有没有办法将其转换为函数?
我正在使用 Storybook 创建有关我在项目中使用的组件的文档。其中一个组件使用了 VueJS 中称为“槽”的功能。在下面的代码片段中,您可以看到使用插槽的故事。
export const IconText = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Button, IconAdd },
template: `
<Button>
<template v-slot:text>
Text
</template>
<template v-slot:icon>
<IconAdd />
</template>
</Button>
`
})
Run Code Online (Sandbox Code Playgroud)
问题是,如果我在 Storybook 中触摸查看这个 Story 的代码预览,我只看到下面的代码片段,我想看看插槽的用法,你知道我该如何实现吗?
<template><Button /></template>
Run Code Online (Sandbox Code Playgroud)