VSCode 中配置代码片段

2022-07-12  本文已影响0人  张_何
"Print to console": {
    "prefix":"log",
    "body":[
        "console.log('$1');",
        "$2"
    ],
    "description": "Log output to console"
}
{
    "styled.div": {
        "prefix": "stiv",
        "body": [
            "import styled from 'styled-components';",
            "",
            "const $1Cmp = styled.div`",
            "",
            "`;",
            "",
            "export {",
            "    $1Cmp",
            "}"
        ],
        "description": "styled.div"
    },
    "styled.divp": {
        "prefix": "stivp",
        "body": [
            "import styled from 'styled-components';",
            "",
            "const $1Cmp = styled.div`",
            "    $2: ${props=>props.$2};",
            "`;",
            "",
            "export {",
            "    $1Cmp",
            "}"
        ],
        "description": "styled.divp"
    }
}
"useState": {
    "prefix": "useState",
    "body": [
        "const [$1, set$1] = useState($2);"
    ],
    "description": "useState"
},
"function": {
    "prefix": "func",
    "body": [
        "const $1 = ($2)=>{",
        "",
        "}"
    ],
    "description": "function"
}
上一篇 下一篇

猜你喜欢

热点阅读