vscode|vscode + vue 配置指南
【vscode|vscode + vue 配置指南】工欲善其事必先利其器
setting.json
{
"explorer.confirmDelete": false,
"sync.gist": "a2ec5286250f18947abc5e9043c9c92d",
"workbench.colorTheme": "One Dark Pro",
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"emmet.triggerExpansionOnTab": true,
"files.associations": {
"*.vue": "vue"
},
"prettier.semi": true,
"prettier.singleQuote": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"stylusSupremacy.insertColons": false,
"stylusSupremacy.insertSemicolons": false,
"stylusSupremacy.insertBraces": false,
"stylusSupremacy.insertNewLineAroundImports": false,
"stylusSupremacy.insertNewLineAroundBlocks": false,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
}
},
"liveServer.settings.donotShowInfoMsg": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"window.zoomLevel": 0,
"git.autofetch": true,
"todohighlight.isEnable": true,
"todohighlight.isCaseSensitive": true,
"todohighlight.keywords": [
"DEBUG:",
"REVIEW:",
{
"text": "NOTE:",
"color": "#ff0000",
"backgroundColor": "yellow",
"overviewRulerColor": "grey"
},
{
"text": "HACK:",
"color": "#000",
"isWholeLine": false,
},
{
"text": "TODO:",
"color": "red",
"border": "1px solid red",
"borderRadius": "2px",
"backgroundColor": "rgba(0,0,0,.2)",
},
{
"text": "ERR:",
"color": "#FFF",
"border": "1px solid #000",
"borderRadius": "2px",
"backgroundColor": "red",
},
{
"text": " ppExt:",
"color": "#fff",
"border": "1px solid #fff",
"borderRadius": "2px", //NOTE: using borderRadius along with `border` or you will see nothing change
"backgroundColor": "purple",
//other styling properties goes here ...
}
],
"search.followSymlinks": false,
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.hg": true,
"**/.svn": true,
"**/bower_components": true,
"**/CVS": true,
"**/node_modules": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/bower_components/**": true,
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"git.enableSmartCommit": true,
"git.confirmSync": false,
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
- 插件
Auto Close Tag
Auto Complete Tag
Auto Rename Tag
Beautify
Bracket Pair Colorizer
Chinese (Simplified) Language Pack for Visual Studio Code
Code Runner
Color Highlight
Color Picker
CSS Peek
Debugger for Chrome
Document This
DotENV
EditorConfig for VS Code
Git History
Git History Diff
GitLens — Git supercharged
Highlight Matching Tag
HTML CSS Support
HTML Snippets
IntelliSense for CSS class names in HTML
JavaScript (ES6) code snippets
language-stylus
Live Server
Manta's Stylus Supremacy
Node JSON Autocomplete
npm
npm Intellisense
One Dark Pro
Path Autocomplete
Path Intellisense
Prettier - Code formatter
Project Manager
Pug (Jade) snippets
Sass
Settings Sync
TODO Highlight
Todo Tree
Vetur
vscode-icons
VueHelper
yarn
Code Spell Checker
-
vue
模板
{
// vue 页面模板
"Print to vue": {
"prefix": "vue",
"body": [
"",
"div.main$2",
"\n",
"\n",
"",
"",
],
"description": "template output to vue"
},
// vue 组件模板
"Print to comp": {
"prefix": "comp",
"body": [
"",
"div.comp$2",
"\n",
"\n",
"",
"",
],
"description": "component output to vue"
}
}
-
vconsole
全局snippets
{
// console / vconsole
"Print to console": {
"scope": "javascript,typescript",
"prefix": "log",
"body": [
"console.log('$1', $2);
",
],
"description": "Log output to console"
},
"Print to vconsole info": {
"scope": "javascript,typescript",
"prefix": "info",
"body": [
"console.info('$1', $2);
",
],
"description": "vconsole info"
},
"Print to vconsole warn": {
"scope": "javascript,typescript",
"prefix": "warn",
"body": [
"console.warn('$1', $2);
",
],
"description": "vconsole warn"
},
"Print to vconsole error": {
"scope": "javascript,typescript",
"prefix": "err",
"body": [
"console.error('$1', $2);
",
],
"description": "vconsole error"
}}
插件配置
project manager
[{
"name": "vue-mcli",
"rootPath": "$home\\mock\\inside\\vue-mcli",
"paths": [],
"group": "",
"enabled": true
}]
Debugger for Chrome
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "vue-mcli",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"sourceMaps": true
}
]
}
备注_malk vue cli _
Debugger for Chrome
运行会另启动一个Chrome
进程,通过断点调试(果断抛弃console
)Vue DevTools
添加插件到Chrome
,cli
项目若提示Vue.js is detected on this page. Open DevTools and look for the Vue panel.
, 只需重新刷新下浏览器即可
推荐阅读
- vue-cli|vue-cli 3.x vue.config.js 配置
- 2020-04-07vue中Axios的封装和API接口的管理
- 从战略性的角度可以配置股票
- VueX--VUE核心插件
- vue组件中为何data必须是一个函数()
- 用npm发布一个包的教程并编写一个vue的插件发布
- 缓存有关的配置和属性
- Spring|Spring Boot 自动配置的原理、核心注解以及利用自动配置实现了自定义 Starter 组件
- vuex|vuex 基础结构
- Vue源码分析—响应式原理(二)