Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Router.push changes url but doesn't rendering page

$
0
0

This sample code changes url path, but app doesn’t render pages.
What can I do?

<template>
  <ion-page>
    <ion-content>      
      <ion-grid>
        <ion-row>
          <ion-col size="12">
            <ion-button @click="end()" expand="block">
              <ion-label class="ion-text-wrap"End</ion-label>
            </ion-button>
          </ion-col>
        </ion-row>
      </ion-grid>
    </ion-content>
  </ion-page>
</template>

<script lang="ts">
import { defineComponent, reactive } from 'vue';
import { useRouter } from 'vue-router';

export default defineComponent({
  name: 'Page2',
  components: {
  },
  setup() {
    const router = useRouter();
    const end = () => {
      // something to do.
      return router.push({ name: 'Home'});
    };
    return {
      end,
    }
  },
});
</script>

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>