一、Vscode配置
1、进入首选项=>用户配置代码片段=>javascript
{
"Print to zhushi": {
"prefix": "zhushi",
"body": [
"<!--",
"* @Description: $0",
"* @Author: your name",
"* @Date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
"* @LastEditTime: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
"* @LastEditors: Please set LastEditors",
"-->"
],
"description": "a zhushi mode"
},
"Print to func": {
"prefix": "func",
"body": [
"/**",
" * @func $1",
" * @Description $2",
" * @Author: your name",
" * @param {$3} $4 $5",
" * @return {$6} $7",
" */"
],
"description": "a func mode"
}
}
2、=>vue
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script>",
"export default {",
" components: {},",
" props: {},",
" data() {",
" return {",
" };",
" },",
" watch: {},",
" computed: {},",
" methods: {},",
" created() {},",
" mounted() {}",
"};",
"</script>",
"<style lang=\"scss\" scoped>",
"</style>"
],
"description": "A vue file template"
}
}
在页面输入prefix相应的字段回车即可得当body中配置的内容,自己可以随意配置body中的内容。
此文借鉴的是小白白纳的文章