美文网首页
VS Code 用户代码片段

VS Code 用户代码片段

作者: 一名有马甲线的程序媛 | 来源:发表于2018-07-09 14:47 被阅读12次

文件—首选项—用户代码片段

{
 // 文档注释
 "Documentation Comments": {
  "scope": "javascript,typescript,html,vue",
  "prefix": "lv-cia",
  "body": [
   "/**",
   " * ${1:描述}",
   " @author will",
   " @time ${2:time}",
   " */",
   "$0"
  ],
  "description": "文档注释"
 },

 // html viewport
 "Html viewport": {
  "scope": "html",
  "prefix": "metavp",
  "body": [
   "<meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">"
  ],
  "description": "html viewport"
 },

 // vue 单文件模板
 "Create a template": {
  "scope": "vue",
  "prefix": "vuec",
  "body": [
   "<template>",
   "  <div ${0}>",
   "",
   "  </div>",
   "</template>",
   "",
   "<script>",
   "export default {",
   "  name: '${1}',",
   "  components: {},${2:",
   "  directives: {\\},}${3:",
   "  filters: {\\},}${4:",
   "  mixins: [],}${5:",
   "  props: {\\},}${6:",
   "  data() {",
   "    return {\\}",
   "  \\},}${7:",
   "  computed: {\\},}${8:",
   "  watch: {\\},}${9:",
   "  mounted() {\\},}${10:",
   "  methods: {\\}}",
   "}",
   "</script>",
   "",
   "<style lang=\"less\" ${11:scoped}>",
   "",
   "</style>",
  ],
  "description": "vue 单文件模板"
 }
}

相关文章

网友评论

      本文标题:VS Code 用户代码片段

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