-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Supporting <script setup> #2296
Comments
nice but hack |
This feature need to add wrapper code like template Interpolation. |
async setup should be considered also, e.G. SomeComponent.vue
|
When using export default it also not recognize props. Component.vue <template>
<h1>{{ msg }}</h1>
<button @click="count++">count is: {{ count }}</button>
</template>
<script setup="props" lang="ts" async>
import { ref } from 'vue';
export default {
props: {
msg: {
type: String,
default: 'default msg',
},
},
};
console.log(props.msg); // Cannot find name 'props'.Vetur(2304)
export const count = ref(0);
</script> |
I don't know how the language server is implemented underneath, but |
It's actually not that simple. |
Is there a way to disable I know it's very early days still, Thank You all for your hard work with Vetur 👍 |
@Uninen If you look at recent changes made to vitepress, Evan seems to suggest the team to use Volar instead of Vetur for now, so maybe you can try using that until Vetur is up-to-date. |
yo. Any news on this one ? |
2 month bump 🎂 |
+1. |
Now that Vue 3.2 is out with stable support for this, is this landing soon? |
any update about this? |
@zynth17, @arafatamim, and others If you take a look at how Evan recently responded about the recommended approach going forward, it seems that volar is currently the extension of choice for vue 3. I've been using volar for several months, and so far the auto-completion in both |
i do love volar but what i dont like from volar is it doesn't support the autoclosing tag |
@boonyasukd Does that mean that Vetur has no close plans to implement |
@ivan-bragin That I don't really know. I'm just a regular vue user who happens to follow Evan closely on Twitter and Github, so I noticed the change in recommendation. If you want to know that, you probably have to ask vetur maintainer(s). |
I have two solutions to avoid this error for now
|
For now can just disable Vetur for script section and use ESlint, TSLint VS Code JSON config line |
Currently, I had Vue 2 project but using the <script setup>, and using Volar is bad, it always "heap out of memory". So using Vetur is a good choice for now. And disabling script validation working at least for now. |
Just a heads up if you installed volar to get the setup support it seems like you also have to uninstall vetur as well in order to get it to work. (at least thats what I had to do) |
Yeah, the best is to create a workspace with Vetur disabled, it might be that you have projects without the |
|
You should be using volar nowadays. It has superseded vetur afaik. |
Sorry, not very related to this thread, but please upvote microsoft/vscode#143531 to get more Vue 3 users to |
From what I can see Volar is the go-to now - what does Vetur do that Volar doesn't? |
Volar author is here. 👋 First of all, I'm sorry if I'm uncomfortable discussing Volar here! Vetur does have some unique features, such as ESLint, highly configurable formatters, Snippets... Volar deliberately avoids adding these features based on some design principles, but at the same time Volar also adds a lot of other unique features, I believe the overall DX is better. I think currently the most important difference between Vetur and Volar is that Vetur automatically wraps component options with Directly exporting component options is a common practice for some Vue2 and JS users. If you like to export component options directly, or rely on Vetur's unique features, I don't think you need to change your habits, just continue to use Vetur. |
You can use volar and then disable the vetur rule.
|
Hi |
It purposely highlights components differently than html elements. It's a feature, not a bug. You could try writing a theme / changing the color token for components in Volar in VSCode JSON Settings |
FYI, you can now use some Vetur features within Volar 0.36 now, as per @johnsoncodehk 's own tweet. So going forward the feature gap between the two extensions should be closing. https://github.com/johnsoncodehk/volar-plugins/tree/master/packages/vetur |
@fallsimply |
Fixed in d89071c |
great |
This is still happening to me in latest vetur version |
same (in v0.37.3) |
Feature Request
Earlier this year Evan introduced a new RFC to improve upon the script section to support
<script setup>
. This RFC is already included as part of thevue@next
, andvue-loader
was recently updated to support it, so it's my hope thatvetur
will update to support this as well, since without it intellisense doesn't work correctly. The error I got wasThe text was updated successfully, but these errors were encountered: