vscode-用户片段-html.json

410 阅读1分钟
    {
	// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
	// description. 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:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }
  "vue": {
    "prefix": "hv",
    "body": [
  "<div id=\"app\">",
  "  <h2>{{message}}</h2>",
  "</div>",
  "",
  "<script src=\"https://cdn.jsdelivr.net/npm/vue@2.6.14\"></script>",
  "<script>",
  "  const app = new Vue({",
  "    el: '#app',",
  "    data: {",
  "      message: 'hello',",
  "    }",
  "  })",
  "</script>",
    ],
    "description": "vue components"
  },
  "regEmail":{
    "prefix": "regEmail",
    "body": [
      "const regEmail = /^[a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/",
    ],
    "description": "regEmail components"
  },
  "regMobile":{
    "prefix": "regMobile",
    "body": [
      "const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/",
    ],
    "description": "regMobile components"
  },
  "echarts":{
    "prefix": "echarts",
    "body": [
        "<!DOCTYPE html>",
        "<html lang=\"en\">",
        "<head>",
        "  <meta charset=\"UTF-8\">",
        "  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">",
        "  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
        "  <title>Document</title>",
        "  <script src=\"lib/echarts.min.js\"></script>",
        "</head>",
        "<body>",
        "  <div style=\"width: 600px;height: 400px;\"></div>",
        "   ",
        "  <script>",
        "    var mCharts = echarts.init(document.querySelector('div')) ",
        "   ",
        "    var option = {",
        "      title: {",
        "        text: '$1',",
        "        link: '',",
        "        textStyle: {",
        "          ",
        "        }",
        "      },",
        "      xAxis: {",
        "        type: '',",
        "        data:   ",
        "      },",
        "      yAxis: {",
        "        type: ''",
        "      },",
        "      series: [",
        "        {",
        "          name: '',",
        "          type: '',",
        "          data:   ",
        "        }",
        "      ]",
        "    }",
        "     ",
        "    mCharts.setOption(option)",
        "  </script>",
        "  ",
        "</body>",
        "</html>",
    ],
    "description": "echarts components"
  }
}
`