Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>QG MUI SnippetsNew to Visual Studio Code? Get it now.
QG MUI Snippets

QG MUI Snippets

shindouhiro

|
2 installs
| (0) | Free
实用的 React 和 TypeScript 代码片段集合
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code Snippets

这是一个为 React 和 TypeScript 开发者准备的实用代码片段集合。

特性

这个扩展提供了以下常用的代码片段:

React 相关

  • rfc - 创建 React 函数组件
  • us - 创建 useState Hook
  • ue - 创建 useEffect Hook

TypeScript 相关

  • int - 创建 TypeScript 接口
  • type - 创建 TypeScript 类型定义

使用方法

  1. 在 VS Code 中安装此扩展
  2. 打开一个 TypeScript (.ts) 或 TypeScript React (.tsx) 文件
  3. 输入上述任一触发词(如 rfc)
  4. 按 Tab 键或 Enter 键来展开代码片段

代码片段详情

React 函数组件 (rfc)

import React from 'react';

interface ComponentNameProps {
  
}

export const ComponentName: React.FC<ComponentNameProps> = (props) => {
  return (
    <div>
      
    </div>
  );
};

useState Hook (us)

const [state, setState] = useState<type>();

useEffect Hook (ue)

useEffect(() => {
  
}, []);

TypeScript 接口 (int)

interface InterfaceName {
  
}

TypeScript 类型 (type)

type TypeName = {
  
};

安装

您可以通过以下方式安装此扩展:

  1. 在 VS Code 中打开扩展面板 (Ctrl+Shift+X)
  2. 搜索 "VS Code Snippets"
  3. 点击安装

贡献

欢迎提交 Issue 和 Pull Request 来帮助改进这个扩展。

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft