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

Option to change the order of template and script blocks #106

Open
avxkim opened this issue Feb 6, 2022 · 5 comments
Open

Option to change the order of template and script blocks #106

avxkim opened this issue Feb 6, 2022 · 5 comments

Comments

@avxkim
Copy link

avxkim commented Feb 6, 2022

vbase-3-ts-setup produces the following layout:

<template>
  <div>

  </div>
</template>

<script setup lang="ts">

</script>

<style scoped>

</style>

Is it possible to change the arrangement to

<script setup lang="ts">

</script>

<template>
  <div>

  </div>
</template>

<style scoped>

</style>
@dajpes
Copy link

dajpes commented Mar 23, 2022

Any Update on this? @sdras

@messenjer
Copy link

There is one PR here #110

@fransyrcc
Copy link

Hi, it would be good to leave both cases as specified in the documentation for a single-file component top-level element order. The important part is to leave <style> last.

There is a PR that allows both:

@PBK-B
Copy link

PBK-B commented Jul 14, 2022

Let's solve it with one line script 😝

  1. Open the terminal execution in the working directory
    mkdir -p .vscode && curl -L https://raw.githubusercontent.com/sdras/vue-vscode-snippets/943ccfc9ba0b3b85d05dfc8b6f9e220db8ebc81e/snippets/vue.json -o .vscode/vue.json.code-snippets

  2. Try typing vbase-3-ts-setup-first and it will work wonders

Thank you @sdras for your contribute, hope it can help you
Thank you also for the contributor of this project

@ExEr7um
Copy link

ExEr7um commented Aug 23, 2022

I was very annoyed by that too, so I made my own version of extension.

It was built for Vue 3 only. I tuned some existing snippets, added new ones and removed everything related to Vue 2.

Feel free to try it. You can find it here: https://github.com/ExEr7um/vue3-vscode-snippets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants