vscode提示快捷鍵是Ctrl + space(空格 ),但是Ctrl + space是系統輸入法切換快捷鍵,這樣就會有沖突
在vscode中按Ctrl + Shift + P 輸入key命令keyboard
將以下JSON復制進入
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+oem_2",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+space",
"command": "-editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
}
]
將快捷鍵重新設置后可以使用Alt + /
和Ctrl + I
代碼提示建議
用戶代碼片段 設置-用戶代碼片段-vue.json中設置如下
vue3
{
"vue3 setup": {
"prefix": "vvs",
"body": [
"<script setup lang=\"ts\">",
"import { ref, onMounted } from \"vue\";",
"$1",
"</script>",
"<template>",
"$2",
"</template>",
"<style lang=\"less\" scoped></style>"
],
"description": "vue setup"
},
"vue3 base": {
"prefix": "vv3",
"body": [
"<script lang=\"ts\">",
"import { defineComponent } from \"vue\";",
"export default defineComponent({",
" name: \"ComponentName\",",
" setup() {},",
"});",
"</script>",
"<template>",
"$1",
"</template>",
"<style lang=\"less\" scoped></style>"
],
"description": "vue template"
}
}