peter.kormos
peter.kormos

Reputation: 5

How to solve vue-rx incompatiblity with Vue3 in Spring Boot Admin

Can you please help in how to import and use vue-rx with spring boot admin ui components? I always run into errors. I am a beginner, the application worked in Vue2 and earlier version of Spring Boot Admin. Now in Vue3 it does not. When I try to add add something with 'use' in index.js, I get the error "Vue.use is not a function" I tried to import it in the component too, but I did not manage to make it work. With vue3 syntax it is the same. Thank you for your help!

package.json

...
    "vue": "^3.4.19",
    "rxjs": "^6.6.7",
    "vue-rx": "^6.2.0",
    "vuex": "^4.1.0"

    "devDependencies": {
    "@vitejs/plugin-vue": "^5.0.4",
    "@vue-macros/reactivity-transform": "^0.4.3",
    "@vue/compiler-sfc": "^3.4.19",
    "vite": "5.1.1",
    "vite-plugin-static-copy": "^1.0.1"
...

index.js:

import custom from "./custom.vue";
import { createApp } from 'vue';
import VueRx from 'vue-rx';

SBA.use({
  install({viewRegistry}) {
    
    //use VueRx in Spring Boot Admin UI components
    const app = createApp(custom); 
    app.use(VueRx);   // THIS LINE throws the error.
    app.mount('#custom')

    viewRegistry.addView({
      name:   'instances/custom',
      parent: 'instances',
      path:   'custom',
      component: customEndpoint,
      label: 'New menu',
      group: 'custom',  //Group
      order: -10,                   // Orig: 1000
      isEnabled: ({ instance }) => {
        return instance.hasEndpoint("custom");},
    });
  }
});

The error:

    at vue-rx.esm.js:310:7
    at custom-ui.js:2:241
    at custom-ui.js:3:3

Upvotes: 0

Views: 82

Answers (0)

Related Questions