Support Vuetify's 'v-img' 'src' attribute in 'transformToRequire` defaults
See original GitHub issueWhat problem does this feature solve?
vue-loader
does not automatically require
assets referenced in the src
attribute of Vuetify’s v-img
tag.
Given that Vuetify is a prominent part of Vue’s ecosystem and v-img
is often a drop-in replacement for img
, supporting this natively would be desirable.
Current workarounds to this problem are not seamless and have a more awkward syntax.
What does the proposed API look like?
No API surface changes are required.
Template markup looking like <v-img src="@/assets/logo.png">
will now compile properly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
VueJS: Building dynamic src path for Vuetify v-img
We only store the image's Id which is then dynamically inserted into the src attribute of v-img . But dynamically inserting src value...
Read more >Using vue-template-loader with Vue.js to Compile HTML ...
Since vue-template-loader supports vue-class-component we can use decorators on ... the src attribute of ** tags can specified with options:.
Read more >Image component — Vuetify
Usage. v-img component is used to display a responsive image with lazy-load and placeholder.
Read more >Grab first <img> or <img> src from Rich Text field
I need to use this image as the overview thumbnail on a listing page. How can I extract that image tag, or just...
Read more >Vue/Vuetify And Binding Carousel Img Src With A Method Not ...
vue-loader automatically converts project relative src attributes on <img> tags, but doesn't automatically for BootstrapVue custom components that accept ...
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
You can use Vue Loader’s
transformAssetUrls
option to configure your own element/attribute combinations to be transformed. If you want that out-of-the-box, I think it’s better to let Vuetify integrate this feature into their Vue CLI plugin.transformAssetUrls
/cc @johnleider
Note, it is still a very minor bug that https://github.com/vuejs/component-compiler-utils/pull/45 never downstreamed documentation updates to
vue-loader
andvue-component-compiler
.