Closed elitastic closed 5 years ago
Hi @elitastic,
Thanks for your suggestion.
I never used an external script for SFCs. Is this a common use case?
It's at least mentioned in the VueJs documentation:
https://vuejs.org/v2/guide/single-file-components.html#What-About-Separation-of-Concerns
For me it's useful for some slightly bigger components (150 - 200 lines of code). For me, it's more convenient to change the active window than to scroll up and down all time between html and typescript code.
I will have a look the next time I do some maintenance.
The contents of your script are EXACTLY what would be in the tag, and the current generated code would work as is in the new file, yes?
Yes, exactly!
@elitastic I did some refactoring and got this working. It actually now runs across the board about 3x faster, works with es6 and commonjs exports, and will even create the external script file if it does not exist.
A couple days of testing and I will submit it to the IJ repo.
Perfekt, thanks a lot for your quick help!
Another question, is it by design / restrictions that expressions within double braces don't have intellisense / error checking?
It works for expressions within v-if etc. but not within double braces.
Are you referring to the IntelliVue plugin, or the standard Vue plugin?
Just realized that this comes from the standard vue plugin! Sorry for that!
Instead of relying on the Vue plugin, or an AST, we just process raw text. In fact, you can put the cursor in a comment anywhere in the file and still extract or goto a Vue item. We are not sure if this is a feature or a bug ;)
@elitastic We released version 1.0.0 with support for this feature.
Hi, it would be very nice if external ts files would be supported, e.g.:
.vue file:
test.ts file:
Within Rider, the onClick method is not recognized when in external file:
But it works when everything is inside the .vue file