*** Tạo snippets mới cho VSCode
-- Vào File >> Preferences >> User snippets >> New Global snippets file ...
1. Snippets for HTML5
12345678910111213141516171819202122
{ "Create <table></table>": { "scope": "html", "prefix": "table", "body": [ "<table>", "\t<thead>", "\t\t<tr>", "\t\t\t<th>#</th>", "\t\t\t<th>$0</th>", "\t\t</tr>", "\t</thead>", "\t<tbody>", "\t\t<tr>", "\t\t\t<td></td>", "\t\t</tr>", "\t</tbody>", "</table>" ], "description": "Create <table></table>" }}
2. Snippets for Javascripts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
{ "Create <table></table>": { "scope": "html", "prefix": "table", "body": [ "<table>", "\t<thead>", "\t\t<tr>", "\t\t\t<th>#</th>", "\t\t\t<th>$0</th>", "\t\t</tr>", "\t</thead>", "\t<tbody>", "\t\t<tr>", "\t\t\t<td></td>", "\t\t</tr>", "\t</tbody>", "</table>" ], "description": "Create <table></table>" } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
{ "$('element').": { "scope": "javascript", "prefix": "$", "body": ["$('$1').$0"], "description": "Use const $" }, "const $ = document.querySelector.bind(document)": { "scope": "javascript,html", "prefix": "$", "body": ["const $ = document.querySelector.bind(document);", "$0"], "description": "Create const $" } } |
3. Snippets for VueJS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
{ "Default Vue": { "scope": "vue", "prefix": ["vue", "cvue"], "body": [ "<template>", "\t<div>", "\t\t$0", "\t</div>", "</template>", "", "<script>", "export default {", "\tdata() {", "\t\treturn {", "\t\t\t", "\t\t}", "\t},", "", "\tmethods: {", "\t\t", "\t},", "}", "</script>", "", "<style scoped>", "\t", "</style>" ], "description": "Demo file Vue " } } |