当您打开扩展程序的配置时,VScode会通知您:
记得重新启动VScode
但它没有说明如何.他们使用大写字母restart,所以通常,如果你强调一个称谓,它应该意味着什么.是否有一些隐藏的重启按钮或键快捷键?如何重新启动IDE?
var MainTable = Vue.extend({
template: "<ul>" +
"<li v-for='(set,index) in settings'>" +
"{{index}}) " +
"{{set.title}}" +
"<button @click='changeSetting(index)'> Info </button>" +
"</li>" +
"</ul>",
data: function() {
return data;
}
});
Vue.component("main-table", MainTable);
data.settingsSelected = {};
var app = new Vue({
el: "#settings",
data: data,
methods: {
changeSetting: function(index) {
data.settingsSelected = data.settings[index];
}
}
});
Run Code Online (Sandbox Code Playgroud)
使用上面的代码,单击按钮时会出现以下错误.
[Vue警告]:属性或方法"changeSetting"未在实例上定义,但在呈现期间引用.确保在数据选项中声明反应数据属性.(找到
<MainTable>)
当我Format Document在Vue Component.vue文件上执行命令时,VSCode用双引号字符串替换所有单引号字符串.
在我的特定情况下,此规则与需要单引号的electron-vue lint配置冲突.
我没有安装更漂亮的扩展程序(在我的设置中没有prettier.singleQuote)
如何自定义vscode以避免这种情况?
我的 VS 代码上的漂亮扩展无法格式化 HTML。
在加载 VS 代码时,我在控制台中收到此错误 -
在尝试格式化时,我在底部看到此消息 -
注 - TS 文件和 SCSS 文件的格式正确。它仅适用于 HTML 文件。
以下是我基于 HTML 语言的设置 -
{
"tslint.rulesDirectory": "./node_modules/codelyzer",
"typescript.tsdk": "node_modules/typescript/lib",
"window.zoomLevel": 0,
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.associations": {
"*.html": "html"
}
}
Run Code Online (Sandbox Code Playgroud)
这些是安装和启用的扩展 -
更漂亮的版本—— 2.2.2
VS Code 版本(来自关于 VS 代码部分):
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 …Run Code Online (Sandbox Code Playgroud) 我正在使用nuxt.js创建一个应用程序,但是每次启动该应用程序时,都会出现eslint错误,并说“该--fix选项可能可修复”。
我执行了命令npm run lint -- --fix,它可以正常工作,但是如果我在任何vue文件中进行其他更改,它都会再次出现相同的错误,因此我必须再次执行此操作
关于如何解决这个问题的任何想法?
我想在 vscode 中使用 ctrl+K ctrl+F 自动对齐我的 .cpp 代码,但是当我复制代码时,提示“没有安装‘cpp’文件的选择格式化程序”不起作用在 vscode 中格式化 Interactive Playground 的一部分,它可以工作。为什么?真奇怪?
我最近更新了 VSCode,Prettier 不再对我的 JS 文件起作用。以前每当我保存 JS 文件时,Prettier 都会为我添加分号。现在,当我保存时,不会添加分号。我启用了插件并检查了设置以确保启用了分号插入。什么可能导致此错误?
每次打开 VS Code 升级后,我都会得到一个Error loading workspace folders甚至所有扩展都不起作用
go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin ibm.com/cloudbroker/order/...]: exit status 1: build flag -mod=readonly only valid when using modules
: packages.Load error[![enter image description here][1]][1]
Run Code Online (Sandbox Code Playgroud)
go 版本 go1.12.17 darwin/amd64 VsCode 版本:1.52.1 操作系统:Darwin x64 20.2.0
visual-studio-code vscode-settings prettier prettier-eslint prettier-vscode