Intellij Vue 项目在标记后更改缩进级别<script>



所以我在一个主要使用VSCode进行前端工作的团队中工作,我自己使用Intellij,因为这是我对自己的适应。问题是,当我使用 Intellij 格式化代码时,它会在<script><style>标记中的代码中添加初始缩进,这不是世界上最大的问题 - 只是有点痛苦。

他们的代码如下所示:

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
export default class CollapsibleSection extends Vue {
@Prop() public index: any;
@Prop() public value: any;
public isActive() {
return this.index === this.value;
}
}
</script>

我的代码如下所示:

<script lang="ts">
import {Component, Prop, Vue} from 'vue-property-decorator';
@Component
export default class CollapsibleSection extends Vue {
@Prop() public index: any;
@Prop() public value: any;
public isActive() {
return this.index === this.value;
}
}
</script>

这将在下一个主要版本2020.2中修复,请参阅 WEB-30382。

现在,请尝试将scriptstyle添加到"设置"中的"不缩进子项"|">编辑 |代码样式 |网页 |其他

最新更新