Files
yongyuancv.cn/pages/posts/mdx.mdx
2022-04-06 10:08:45 +08:00

28 lines
694 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export const meta = {
"title": "MDX 格式介绍",
"date": "2022-03-04",
"description": "MDX 允许您在 Markdown 文件中使用 JavaScript。与现代 JavaScript 框架结合让编写内容更优雅。"
};
import PostLayout from '../../components/PostLayout';
import { Button } from '@mui/material';
import Chart from '../../components/Chart';
这是普通 Markdown 的语法
- One
- Two
- Three
这是在 Markdown 中使用 JavaScript 引用的组件
<Button variant="contained">按钮</Button>
将 Markdown 拓展到 Javascript意味着丰富的生态和组件库
`chart.js` 示例
<Chart />
export default ({children}) => <PostLayout meta={meta}>{children}</PostLayout>