輸入vue.json
{ "Print to console": { "prefix": "vv", "body": [ "<template>", " <div>$0</div>", "</template>", "", "<script>", "export default {", "", " components: {", "", " },", "", " data() {", " return {", " ", " }", " },", "", " created() {", "", " },", "", "", " mounted() {", " this.onLoad()", " },", "", " methods: {", " onLoad() {}", " }", "", "}", "", "</script>", "<style lang=\"scss\">", "", "</style>", "", ], "description": "Log output to console" } }
字段注釋
prefix :這個參數是使用代碼段的快捷入口,比如這里的log在使用時輸入log會有智能感知. body :這個是代碼段的主體.需要設置的代碼放在這里,字符串間換行的話使用 \r\n換行符隔開.注意如果值里包含特殊字符需要進行轉義. $1 :這個為光標的所在位置. $2 :使用這個參數后會光標的下一位置將會另起一行,按tab鍵可進行快速切換 description :代碼段描述,在使用智能感知時的描述