Home > Mobile >  Vue 2 package inside Vue 3 project (this.$set is not a function inside package)
Vue 2 package inside Vue 3 project (this.$set is not a function inside package)

Time:07-15

I'm having some issues with a package that uses Vue 2 inside my Vue 3 project (issue happened on 3.0.0. and also on 3.2.37 when updated). Package: https://github.com/Seungwoo321/vue-pivottable Uses: "vue": "^2.6.10",

When I try to integrate this component inside my project, it doesn't work and console logs this.$set is not a function inside PivottableUi.js?4d01:252:1 i.e. the imported package.

It seems like $set was removed from Vue 3 so I'm wondering if I can fix this problem in any way other than copying and fixing the code of the component.

I would like to use this component so I don't have to implement PivotTable.js (vue-pivottable is vue implementation of it( directly since it will make my workload smaller and I don't need add more dependencies.

CodePudding user response:

You can't use Vue 2 packages with Vue 3. You may fork it and make compatible by yourself.

  • Related