Create a vue temlate for VsCode

Create a vue temlate for VsCode

  1. File -> Preference -> User Snippets

  2. New snippets file for "Folder Name"

  3. Name:"vue.json"

  4. {
    	"vue": {
    		"prefix": "vue",
    		"scope": "html",
    		"body": [
    			"<!DOCTYPE html>",
    			"<html lang=\"en\">\n",
    
    			"<head>",
    			"\t<meta charset=\"UTF-8\">",
    			"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
    			"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
    			"\t<title>Document</title>",
    			"\t<script src=\"https://cdn.bootcss.com/vue/2.5.16/vue.js\"></script>",
    			"</head>\n",
    
    			"<body>",
    				"\t<div id=\"app\">",
    				"\t\t$1",
    				"\t</div>\n",
    				
    				"\t<script>",
    					"\t\tvar vm = new Vue({",
    						"\t\t\tel: \"#app\",",
    						"\t\t\tdata: {}",
    					"\t\t})",
    				"\t</script>",
    			"</body>"
    		],
    		"description": "init a vue template."
    	}
    }
    
  5. Test in a .html file:input "vue" - > Enter

posted @ 2019-09-19 14:57  KLDN_如初  阅读(147)  评论(0编辑  收藏  举报