Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected format result with newline in vue/html files since version 2.0.0 #3943

Closed
zhaojjiang opened this issue Mar 3, 2024 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@zhaojjiang
Copy link

Steps to reproduce

// .vscode/settings.json
{
  "[vue]": {
    "editor.defaultFormatter": "Vue.volar"
  },
}
<!--  -->
<script setup lang="ts">
</script>

<template>
  <router-view v-slot="{ Component, route }">
    <keep-alive>
      <component :is="Component" v-if="route.meta.keepAlive" />
    </keep-alive>
    <component :is="Component" v-if="!route.meta.keepAlive" />
  </router-view>
  <template></template>
  <template></template>
  <template></template>
  <div>
    <template></template>
  </div>
</template>

different behavior

format result before extension version 2.0.0

image

format result since extension version 2.0.0

image

problem

the newline between comment and script is unexpected, so is newline between template, and template in div

@sowth
Copy link

sowth commented Mar 7, 2024

same problem, need help!

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

3 participants