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