我有以下苗条的文件:
<script>
import { text } from 'svelte/internal';
</script>
<style lang="scss">
form {
label, input {
font-weight: 800;
}
}
</style>
<form>
<label for="list">List</label>
<input type="text" id="list" />
<label for="password">Password</label>
<input type="password" id="password" />
</form>
当我在这个文件上使用 shift + alt + f 这是我的输出:
<script>
import { text } from 'svelte/internal';
</script>
<style lang="scss">
form {
label,
input {
font-weight: 800;
}
}
</style>
<form><label for="list">List</label> <input type="text" id="list" /> <label for="password">Password</label> <input type="password" id="password" /></form>
所以现在我的标签,CSS 中的输入在不同的行中,而我的 HTML 都在一行中。这与我想要的完全相反。
如何设置 vscode 以正确格式化此文件?