nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple modals not working

Lengo46 opened this issue · comments

commented

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,
  },
}
commented

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