Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么样才能在使用geist的Collapse组件时,插入代码块? #33

Open
ZhaoTim opened this issue Apr 6, 2022 · 0 comments
Open

Comments

@ZhaoTim
Copy link

ZhaoTim commented Apr 6, 2022

HI,Witt,很喜欢你的博客,在尝试使用你的博客模板构建我的博客。

目前在编写博客时遇到了一个问题,在.mdx文件中,尝试使用Collapse组件来包裹Code组件(如下代码),然而渲染到页面中代码却没有生效。

<Collapse shadow title="destructuring-assignment">
  <Code block>
    ```javascript
    const [first, second, third] = 'abc';
    console.log(first);
    console.log(second);
    console.log(third);
    ```
  </Code>
</Collapse>

我查看了geist的文档:Code,按照示例代码修改了我的代码:

<Collapse shadow title="destructuring-assignment">
  <Code block>
     <DemoCode />
  </Code>
</Collapse>

效果却渲染出了这个DemoCode组件(返回了button jsx)。

想麻烦问下,正确的做法应该是什么呢?麻烦了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant