nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components
MIT License
98 stars 10 forks source link

Multiple modals not working #93

Closed Lengo46 closed 3 years ago

Lengo46 commented 3 years ago

I'm trying to implement logic for multiple modals, but it's only showing one modal (the first you clicked) in the app. I doesn't open the other modals available. If I press 1, it opens 1, but can't open 2 & 3, and vice versa. I've tried multiple angles, but I don't find out what's wrong.

Mixin

  navigateToBenchmark(args: EventData) {
    Vue.prototype.$navigator.modal("/1", { fullscreen: true })
  }

  navigateToDailyReward(args: EventData) {
    Vue.prototype.$navigator.modal("/2", { fullscreen: true })
  }

  navigateToChallengeUser(args: EventData) {
    Vue.prototype.$navigator.modal("/3", { fullscreen: true })
  }

Routes.ts


import Bechmark from "./views/modals/benchmark.vue"
import DailyReward from "./views/modals/dailyreward.vue"
import PChallenge from "./views/modals/challenge-user.vue"

export const routes = {
  "/tabsview": {
    component: Tabsview,
  },
  "/login": {
    component: Login,
  },
  "/reset": {
    component: Reset,
  },
  "/profile": {
    component: Profile,
  },
  "/signup": {
    component: Signup,
  },
  "/settings": {
    component: Settings,
  },
  "/1": {
    component: Bechmark,
  },
  "/2": {
    component: DailyReward,
  },
  "/3": {
    component: PChallenge,
  },
}
Lengo46 commented 3 years ago

I've found the problem. I was reloading the same mixins in the modals, which caused the issue.