robcresswell / vue-material-design-icons

Material Design Icons as Vue Single File Components
https://npmjs.com/vue-material-design-icons
MIT License
162 stars 35 forks source link

[Vue 3] warning (deprecation COMPILER_V_BIND_OBJECT_ORDER) #283

Closed magFixCorp closed 2 years ago

magFixCorp commented 2 years ago

I am migrating my project from Vue2 to Vue3. Everything went successful. The only thing that I am getting as a warning is from this library.

 warning  in ./node_modules/vue-material-design-icons/InformationOutline.vue?vue&type=template&id=456649a2

Module Warning (from ./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js):
(Emitted value instead of an instance of Error) (deprecation COMPILER_V_BIND_OBJECT_ORDER) v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attri
bute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.

The solution seems easy, just move the v-bind='$attrs' in the template as a first argument and this warning will be fixed

Regards Nik

magFixCorp commented 2 years ago

I've forked your repo and made the necessary cahanges. https://www.npmjs.com/package/vue-material-design-icons-vue3 git: https://github.com/magFixCorp/vue-3-material-design-icons