美文网首页
vscode代码块

vscode代码块

作者: 太平洋_cfd2 | 来源:发表于2024-06-04 10:13 被阅读0次
  1. https://juejin.cn/post/6844903869424599053
{
    // Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
    // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
    // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 
    // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 
    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 
    // Placeholders with the same ids are connected.
    // Example:
    "log快捷键": {
        "scope": "",
        "prefix": "log",
        "body": [
            "console.log('start======================');",
            "console.log('$1');",
            "console.log('end========================');",
        ],
        "description": "log快捷键"
    },
    "const func快捷键": {
        "scope": "",
        "prefix": "func",
        "body": [
            "const ${1:func} = (${2:params}) => {\n\t$3\n}"
        ],
        "description": "const func快捷键"
    },
    "useEffect 快捷键": {
        "scope": "",
        "prefix": "effect",
        "body": [
                "useEffect(() => {\n\t$2\n}, [$1])",
        ],
        "description": "快速创建 useEffect"
    },
    "useState 快捷键": {
            "scope": "",
            "prefix": "state",
            "body": [
                    "const [$2, set$3] = useState($1)",
            ],
            "description": "快速创建 useState"
    },
    "匿名方法 快捷键": {
        "scope": "",
        "prefix": "func",
        "body": [
                "() => {\n\t$1\n}",
        ],
        "description": "快速创建 useState"
},
"字体属性 快捷键": {
        "scope": "",
        "prefix": "font",
        "body": [
                "fontWeight: '400',",
            "fontSize: pxToVw(13),",
            "color: 'rgba(235, 235, 245, 0.6)',"
        ],
        "description": "快速创建 font属性"
},
"style 快捷键": {
        "scope": "",
        "prefix": "st",
        "body": [
                "style={styles.$1}",
        ],
        "description": "快速创建 font属性"
},
"style属性 快捷键": {
        "scope": "",
        "prefix": "sts",
        "body": [
                "${1:name}: {",
                    "\t$2",
                "},",
        ],
        "description": "快速创建 font属性"
},
"height属性 快捷键": {
        "scope": "",
        "prefix": "he",
        "body": [
                "height: pxToVh($1),\n",
        ],
        "description": "快速创建 height属性"
},
"width属性 快捷键": {
        "scope": "",
        "prefix": "wi",
        "body": [
                "width: pxToVw($1),\n",
        ],
        "description": "快速创建 width属性"
},
"backgroundColor属性 快捷键": {
        "scope": "",
        "prefix": "bg",
        "body": [
                "backgroundColor: '${1:gray}',\n",
        ],
        "description": "快速创建 backgroundColor属性"
},
"borderRadius 快捷键": {
        "scope": "",
        "prefix": "br",
        "body": [
                "borderRadius: pxToVw(${1:12}),\n",
        ],
        "description": "快速创建 borderRadius属性"
},
"paddingHorizontal 快捷键": {
        "scope": "",
        "prefix": "ph",
        "body": [
                "paddingHorizontal: pxToVw(${1:12}),\n",
        ],
        "description": "快速创建 paddingHorizontal属性"
},
"fontSize 快捷键": {
        "scope": "",
        "prefix": "fs",
        "body": [
                "fontSize: pxToVw(${1:12}),\n",
        ],
        "description": "快速创建 fontSize属性"
},
"justifyContent 快捷键": {
        "scope": "",
        "prefix": "jc",
        "body": [
                "justifyContent: '${1:center}',\n",
        ],
        "description": "快速创建 justifyContent属性"
},
"alignItems 快捷键": {
        "scope": "",
        "prefix": "ai",
        "body": [
                "alignItems: '${1:center}',\n",
        ],
        "description": "快速创建 alignItems属性"
},
"marginTop 快捷键": {
        "scope": "",
        "prefix": "mt",
        "body": [
                "marginTop: pxToVh(${1:12}),\n",
        ],
        "description": "快速创建 marginTop属性"
},
"marginVertical 快捷键": {
        "scope": "",
        "prefix": "mv",
        "body": [
                "marginVertical:pxToVh(${1:12}),\n",
        ],
        "description": "快速创建 marginVertical属性"
},
"absolute 快捷键": {
        "scope": "",
        "prefix": "ab",
        "body": [
                "position:'${1:absolute'},\n",
        ],
        "description": "快速创建 absolute属性"
},
"require 快捷键": {
        "scope": "",
        "prefix": "so",
        "body": [
                "source={require('@asset/images/${1:name}.png')}",
        ],
        "description": "快速创建 require属性"
},
"right 快捷键": {
        "scope": "",
        "prefix": "ri",
        "body": [
                "right: pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 right属性"
},
"left 快捷键": {
        "scope": "",
        "prefix": "le",
        "body": [
                "left: pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 left属性"
},
"top 快捷键": {
        "scope": "",
        "prefix": "to",
        "body": [
                "top: pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 top属性"
},
"bottom 快捷键": {
        "scope": "",
        "prefix": "bo",
        "body": [
                "bottom: pxToVh(${1:10}),\n",
        ],
        "description": "快速创建 bottom属性"
},
"marginBottom 快捷键": {
        "scope": "",
        "prefix": "mb",
        "body": [
                "marginBottom: pxToVh(${1:10}),\n",
        ],
        "description": "快速创建 marginBottom属性"
},
"marginHorizontal 快捷键": {
        "scope": "",
        "prefix": "mh",
        "body": [
                "marginHorizontal: pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 marginHorizontal属性"
},
"flexRow 快捷键": {
        "scope": "",
        "prefix": "flexrow",
        "body": [
                "flexDirection: 'row',\n",
        ],
        "description": "快速创建 flexRow 属性"
},
"flexColumn 快捷键": {
        "scope": "",
        "prefix": "flexcolumn",
        "body": [
                "flexDirection: 'column',\n",
        ],
        "description": "快速创建 flexColumn 属性"
},
"borderWidth 快捷键": {
        "scope": "",
        "prefix": "bw",
        "body": [
                "borderWidth:pxToVw(${1:1}),\n",
        ],
        "description": "快速创建 borderWidth 属性"
},
"borderColor 快捷键": {
        "scope": "",
        "prefix": "bc",
        "body": [
                "borderColor:'${1:rgba(0, 0, 0, 1)}',\n",
        ],
        "description": "快速创建 borderColor 属性"
},
"marginRight 快捷键": {
        "scope": "",
        "prefix": "mr",
        "body": [
                "marginRight:pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 marginRight 属性"
},
"marginLeft 快捷键": {
        "scope": "",
        "prefix": "ml",
        "body": [
                "marginLeft:pxToVw(${1:10}),\n",
        ],
        "description": "快速创建 marginLeft 属性"
},
"device 快捷键": {
        "scope": "",
        "prefix": "de",
        "body": [
        "useEffect(() => {",
        "const remove = DeviceEventEmitter.addListener(notificationKey.${1:go_to_music_detail}, (${2:songImage})=>{\n",
    "})",
    "return ()=>{",
      "remove.remove()",
    "}",
        "}, [])",
        ],
        "description": "快速创建 device 属性"
},
"effectReturn 快捷键": {
        "scope": "",
        "prefix": "effectReturn",
        "body": [
            "useEffect(() => {",
                "return () => {",
                    "${1:DeviceEventEmitter.emit(notificationKey.float_music_panel, true);}",
                "};",
            "}, []);",
        ],
        "description": "快速创建 effectReturn 属性"
},
"navigationType 快捷键": {
        "scope": "",
        "prefix": "navigationType",
        "body": [
            "export type ${1:RecordVoice}RouteParams = {",
                "${2:defaultCount}: ${3:number};",
            "};",
        ],
        "description": "快速创建 navigationType 属性"
},
"StyleSheet 快捷键": {
        "scope": "",
        "prefix": "styleshe",
        "body": [
            "const styles = StyleSheet.create({",
  "$1\n",
"})",
        ],
        "description": "StyleSheet 属性"
},
"navigation 快捷键": {
        "scope": "",
        "prefix": "navi",
        "body": [
            "const navigation = useNavigation()",
        ],
        "description": "快速获取navigation"
},
"inset 快捷键": {
        "scope": "",
        "prefix": "inset",
        "body": [
            "  const inset = useSafeAreaInsets()",
        ],
        "description": "快速获取inset"
},
"useSelector 快捷键": {
        "scope": "",
        "prefix": "selector",
        "body": [
            "const ${1:songDescription} = useSelector((state: RootState)=> state.${2:cache.data.songDescription)}",
        ],
        "description": "快速获取useSelector"
},
"useDispatch 快捷键": {
        "scope": "",
        "prefix": "dispatch",
        "body": [
            "const dispatch = useDispatch()",
        ],
        "description": "快速获取useDispatch"
},
"dispatch 快捷键": {
        "scope": "",
        "prefix": "dispatchSet",
        "body": [
            "const data = ${1:value};",
    "dispatch(setCache(data));",
        ],
        "description": "快速set dispatch"
},
"emit 快捷键": {
        "scope": "",
        "prefix": "emit",
        "body": [
            "DeviceEventEmitter.emit(notificationKey.${1:have_update)}",
        ],
        "description": "快速创建emit"
},
"await 快捷键": {
        "scope": "",
        "prefix": "await",
        "body": [
            "try {",
                "const res = await ${1:referAPI.getCredits();}",
                "\n",
                "}catch (error) {",
                "\n",
                "}",
        ],
        "description": "快速创建await"
},
"color 快捷键": {
        "scope": "",
        "prefix": "co",
        "body": [
            "color:'${1:rgba(0, 0, 0, 1)}',\n",
        ],
        "description": "快速创建 color"
},
"paddingVertical 快捷键": {
        "scope": "",
        "prefix": "pv",
        "body": [
            "paddingVertical:pxToVh(${1:12}),\n",
        ],
        "description": "快速创建 paddingVertical"
},
"paddingTop 快捷键": {
        "scope": "",
        "prefix": "pt",
        "body": [
            "paddingTop:pxToVh(${1:12}),\n",
        ],
        "description": "快速创建 paddingTop"
},
"paddingLeft 快捷键": {
        "scope": "",
        "prefix": "pl",
        "body": [
            "paddingLeft:pxToVw(${1:12}),\n",
        ],
        "description": "快速创建 paddingLeft"
},
"paddingRight 快捷键": {
        "scope": "",
        "prefix": "pr",
        "body": [
            "paddingRight:pxToVw(${1:12}),\n",
        ],
        "description": "快速创建 paddingRight"
},
"paddingBottom 快捷键": {
        "scope": "",
        "prefix": "pb",
        "body": [
            "paddingBottom:pxToVh(${1:12}),\n",
        ],
        "description": "快速创建 paddingBottom"
},

}

相关文章

  • Vscode配置代码块

    日常开发过程中,有一些重复的代码,重新手动写入会添加工作量,减少开发效率,所以配置代码块就非常有必要 点击设置按钮...

  • vscode设置代码块snippets

    为了开发更高效,可以在vscode上配置常用的代码块。 vscode版本 打开user snippets 输入自定...

  • Vue_webpack_Vscode 开发常用插件

    必备: vscode-snippet--------自动生成代码块 配置自定义代码片段: 在vs code中,使用...

  • VScode-flutter 代码块

    您能在这里看到啥 使用效果代码配置项目地址[https://gitee.com/hot_night/dartcod...

  • flutter vscode快捷键

    mbp电脑使用: 自定义代码块 推荐两个快速生成代码块的vscode插件 中文翻译包 快速生成代码 快捷生成组件包...

  • vue开发-VsCode常用插件

    Vue VSCode Snippets 快捷生成代码块Path Autocomplete 自动查找文件路径Chin...

  • Vscode编辑markdown代码块(snippets)

    最近遇到一个问题,用 Vscode 写代码有提示,为什么写 markdown文档没有呢,很不方便。 文件 > 首选...

  • Visual Studio Code (vscode)自定义用户

    IDEA用久了突然换了Visual Stidio Code (vscode)比如fori这样的快捷键就打不出代码块...

  • vscode中自定义代码块

    打开vscode>文件>首选项>用户代码片段>新建json文件 或者按ctrl +shift + p 输入 sni...

  • vscode自定义代码块详解

    日常开发中,代码块的使用,会给我们开发带来极大的便捷,我们可以把一些常用代码编写成代码块,提高我们开发速度。接下来...

网友评论

      本文标题:vscode代码块

      本文链接:https://www.haomeiwen.com/subject/tglyqjtx.html