其他分享
首页 > 其他分享> > js代码片段

js代码片段

作者:互联网

{
    "csl": {
        "prefix": "csl",
        "body": [
            "console.log($0)",
        ],
        "description": "打印log"
    },
    "render": {
        "prefix": "render",
        "body": [
            "render"
        ],
        "description": "javascript:;"
    },
    "MyComponent": {
        "prefix": "MyComponent",
        "body": [
            "import React,{Component} from 'react'\n",
            "export default class MyComponent$0 extends Component{",
            "  render(){",
            "    return (",
            "      <div></div>",
            "    )",
            "  }",
            "}"
        ],
        "description": "React类组件"
    },
    "df": {
        "prefix": "df",
        "body": [
            "()=>{",
            "  //函数体$0", 
            "}",
        ],
        "description": "0826专用的箭头函数"
    },
    "f1": {
        "prefix": "f1",
        "body": [
            "for (var i=0; i<xxxxxxx.length; i++ ){",
            "  //循环体",
            "}",
        ],
        "description": "for循环"
    },
    "forin": {
        "prefix": "forin",
        "body": [
            "for (let index in arr){",
            "  console.log(arr[index])",
            "}",
        ],
        "description": "for-in循环"
    },
    "did": {
        "prefix": "did",
        "body": [
            "document.getElementById('$0')"
        ],
        "description": "document.getElementById"
    },
    "dq": {
        "prefix": "dq",
        "body": [
            "document.querySelector('$0')"
        ],
        "description": "document.querySelector"
    },
    "dqa": {
        "prefix": "dqa",
        "body": [
            "document.querySelectorAll('$0')"
        ],
        "description": "document.querySelectorAll"
    },
    "dtag": {
        "prefix": "dtag",
        "body": [
            "document.getElementsByTagName('$0')"
        ],
        "description": "document.getElementsByTagName"
    },
    "jw": {
        "prefix": "jw",
        "body": [
            "javascript:;"
        ],
        "description": "javascript:;"
    },
    "scr": {
        "prefix": "scr",
        "body": [
            "<script type=\"text/javascript\">"
        ],
        "description": "scr"
    },
    "dfi": {
        "prefix": "dfi",
        "body": [
            "()=>{$0}"
        ],
        "description": "箭头函数"
    },
    "dfp": {
        "prefix": "dfp",
        "body": [
            "value => {$0},",
            "reason => {}",
        ],
        "description": "Promise回调"
    },
    "dfa": {
        "prefix": "dfa",
        "body": [
            "response => {$0},",
            "error => {}",
        ],
        "description": "axios回调"
    },
    "crc": {
        "prefix": "crc",
        "body": [
            "class $0 extends React.Component{",
            "  render(){",
            "    return <h1>hello</h1>",
            "  }",
            "}"
        ],
        "description": "React类组件"
    },
    "rdr": {
        "prefix": "rdr",
        "body": [
            "ReactDOM.render(<$1/>,document.getElementById('$0'))",
        ],
        "description": "rdr"
    },
    "Vue init": {
        "prefix": "v1",
        "body": [
            "new Vue({",
            "\tel:'#root',",
            "\tdata:{",
            "\t\t$0",
            "\t}",
            "})",
        ],
        "description": "Vue Template"
    },
    "preventDefault": {
        "prefix": "preventDefault",
        "body": [
            "preventDefault",
        ],
        "description": "preventDefault"
    },
    "stopPropagation": {
        "prefix": "stopPropagation",
        "body": [
            "stopPropagation",
        ],
        "description": "stopPropagation"
    },
    "target": {
        "prefix": "target",
        "body": [
            "target",
        ],
        "description": "target"
    },
    "keyCode": {
        "prefix": "keyCode",
        "body": [
            "keyCode",
        ],
        "description": "keyCode"
    },
    "split": {
        "prefix": "split",
        "body": [
            "split",
        ],
        "description": "split"
    },
    "slice": {
        "prefix": "slice",
        "body": [
            "slice",
        ],
        "description": "slice"
    },
    "handler": {
        "prefix": "handler",
        "body": [
            "handler",
        ],
        "description": "handler"
    },
    "filter": {
        "prefix": "filter",
        "body": [
            "filter",
        ],
        "description": "filter"
    },
    "indexOf": {
        "prefix": "indexOf",
        "body": [
            "indexOf",
        ],
        "description": "indexOf"
    },
    "unshift": {
        "prefix": "unshift",
        "body": [
            "unshift",
        ],
        "description": "unshift"
    },
    "toUpperCase": {
        "prefix": "toUpperCase",
        "body": [
            ".toUpperCase",
        ],
        "description": "toUpperCase"
    },
    "methods": {
        "prefix": "mt",
        "body": [
            "methods: {",
            "\t$0",
            "}"
        ],
        "description": "methods"
    },
    "Date.now()": {
        "prefix": "Date.now()",
        "body": [
            "Date.now()"
        ],
        "description": "Date.now()"
    },
    "computed": {
        "prefix": "computed",
        "body": [
            "computed: {",
            "\t$0",
            "}"
        ],
        "description": "computed"
    },
    "extend": {
        "prefix": "extend",
        "body": [
            "extend",
        ],
        "description": "extend"
    },
    "prototype": {
        "prefix": "prototype",
        "body": [
            "prototype",
        ],
        "description": "prototype"
    },
    "length": {
        "prefix": "length",
        "body": [
            "length",
        ],
        "description": "length"
    },
    "checked": {
        "prefix": "checked",
        "body": [
            "checked",
        ],
        "description": "checked"
    },
    "hasOwnProperty": {
        "prefix": "hasOwnProperty",
        "body": [
            "hasOwnProperty",
        ],
        "description": "hasOwnProperty"
    },
    "abc":{
        "prefix": "odp",
        "body":[
            "let person = {",
            "\tname:'峰峰',",
            "\tgender:'男',",
            "}"
        ],
        "description": "生成defineProperty"
    }
}

 

标签:body,片段,description,render,代码,unshift,js,prefix,computed
来源: https://www.cnblogs.com/renjianwushu/p/16251745.html