Experimenting with Vue.js the first thing I noticed is how every instance of a component that I define as single file component and include as custom element gets a random hash attribute like data-v-58fd7087=""
.
Specifically:
Could it be generated by Karma or Webpack that are part of my Vue setup? If not, these are some surprising observations to me. It leads to two questions:
Something similar occurs when using scoped CSS with Vue Loader.
I use scoped css and I have attributes like data-v-4646bc3c
, so I figure that is it.
If you don't want this feature, try removing the scoped
attribute from your single file components.
<style scoped> /* local styles */ </style>
If you're using vueify
and you're wondering why you are getting changes in your build without having changed anything, make sure you are running vueify with the process.env.NODE_ENV
set to 'production'
. Otherwise it generates hot-reload code that has new data-v-*
hashes on every build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With