For AI agents: the complete documentation index is available at /docs/llms.txt, the full documentation bundle is available at /docs/llms-full.txt, and this page is available as Markdown at /docs/introduction/tool.md.
  • 简体中文
  • 2026
  • 写作工具

    Rspress 使用技巧

    树形结构:

    docs
    _button.mdx
    index.mdx
    components
    button.tsx

    Tabs:

    docs/index.mdx
    docs/_button.mdx
    components/button.tsx
    import ButtonFragment from './_button.mdx';
    import Button from '../../components/button';
    
    <ButtonFragment />
    <Button />

    Preview 插件,用于展示组件库:

    _demo.tsx
    import { useState } from 'react';
    
    function App() {
      const [count, setCount] = useState(0);
    
      return (
        <div style={{ textAlign: 'center' }}>
          <p>当前计数: {count}</p>
          <button onClick={() => setCount(count + 1)}>+</button>
          <button onClick={() => setCount(count - 1)}>-</button>
        </div>
      );
    }
    
    export default App;