设置别名路径
创建jsconfig.json文件,配置@文件路径
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
]
}
}
}
创建快捷模板
文件->首选项->配置用户代码片段
新建全局代码片段文件 取名即可(例如vue)
取名之后将以下内容复制到文件中,body中的内容可以随自己改变
{
"Print to console": {
"prefix": "vue",
"body": [
"<script setup>",
"import { ref } from 'vue'",
"",
"</script>",
"<template>",
" <div></div>",
"</template>",
"",
"<style scoped>",
"</style>",
],
"description": "Log output to console"
}
}
使用 创建一个vue文件,输入vue即可 enter后即可显示快捷模板中的内容