[Vuejs]-Vue.js (v3): How to have a unique data-v-* hash for each component instance

1👍

That is not possible with vue-loader. And it shouldn’t be done anyway.
The whole point of the data-v-xxx attribute is to identify the components in the DOM so vue can apply to them the correct scoped css.

If it ever applied uniq data-v attributes, it would not be able to apply the correct css.


I understand your problem is that, on production, you see in the css inspector several times the css code, right?

My guess is that it’s related with sourcemaps, which may mess with the css inspector. But I can’t help more without additional details on your project configurations.

Even if your component is used on several pages, its module will be fetched and loaded only once. You don’t have the scoped css loaded several times, it’s just an inspector problem.

Leave a comment