Use with .vue files
See original GitHub issueHello!
I’m having problems using this with .vue
files, is there a way you know of to work around this? What seems to be happening is that vue-loader replaces the render function set by insertRenderer
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Single-File Components - Vue.js
Author modularized components using familiar HTML, CSS and JavaScript syntax; Colocation of inherently coupled concerns; Pre-compiled templates without runtime ...
Read more >Getting started with Vue - Learn web development | MDN
Using Single File Components, Vue lets you group your templates, corresponding script, and CSS all together in a single file ending in .vue...
Read more >How to create a Vue.js app using Single-File Components ...
The most basic Vue project will include an HTML, JavaScript, and a Vue file (the file ending in .vue). We will place these...
Read more >Vue JavaScript Tutorial in Visual Studio Code
To install and use the Vue CLI as well as run the Vue application server, ... see a notification recommending the Vetur extension...
Read more >Going from plain Vue to .vue files - DEV Community
But snoop through some popular Vue projects on GitHub, and you'll find that a lot of them don't organize their components in .js...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, you seems to be misunderstanding how vue-loader and HoC work. vue-loader injects compiled template into exported object. If you want to use template in the
.vue
file, you should export the original object (in your example, you should exportComponent
rather thanconnect
ed object). So, you need to separate the original component and the wrapped component in different files.BTW, I think HoC should not be declared in
.vue
file because it should just connect store and component.No, i’m not misunderstanding, i just explained how it worked? 😕
That’s exactly what i’m saying; why should you have to create two files to make one connected component? Look at React where you have “container components” that do both things in one file.
I just think that developers shouldn’t have to adjust their javascript code because they’re in a
.vue
file. Using higher order functions should always work imo.Having to use two separate files for our “smart” components is off-putting, because it’s extra and unnecessary work.
Anyway, if it’s not going to be supported i think it should at least be noted that it won’t work in
.vue
files and that you should have to use two separate files or render functions.