0

I have a radio button group (created with ant-design-vue) which gets disactivated when I go back (in browser) to that view after having visited another page.

Screenshot of radio-group (https://i.stack.imgur.com/0ow03.png)

I have tried adding state (Vuex - didn't exist previously), I've tried listening to the window popstate and I've tried to re-set the state during the created and mounted lifecycle hooks, but nothing has worked. The project doesn't use a router so that solution is not an option.

Would really appreciate any help.

  • *The project doesn't use a router so that solution is not an option.* How do you do your routing then? – Wimanicesir May 23 '23 at 07:16
  • It's done through window.href. It is really not ideal but for the time being it's the legacy code we have to work with. – Daniel Malmgren de Oliveira May 23 '23 at 08:25
  • 1
    You have to fix bad code? Do it. Don't make it worse by adding shady solutions. What is the use of using a SPA such as Vue, to then ignore the most core item of the system? I would **strongly** advise you to add a router anyway or remove vue entirely, there is no in between. – Wimanicesir May 23 '23 at 08:31
  • Will try adding a router because removing Vue is not an option. Unfortunatelly the vue code that is there adherers very little to the vue way of doing things. No computed props, no watchers, no state management, no routing... – Daniel Malmgren de Oliveira May 23 '23 at 09:29
  • 1
    Then you definitely need to refactor that Vue code so that it begins doing the things in the `vue` way. It's for your own good. – IVO GELOV May 23 '23 at 09:48
  • Agree but that is not the priority of the client. They want us to just add functionality to existing code base. Any idea of how above could be solved not going the Vue way? – Daniel Malmgren de Oliveira May 23 '23 at 10:13
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 24 '23 at 07:22

0 Answers0