NativeScript 8.8.2
I’m new to NativeScript and developing an app following official documentation and tutorials.
I’m trying to navigate to below page
app/components/SelectCentre.vue
while text “Change Centre” is tapped. I’ve tried different moduleName
but none of them actually works and threw the same error: Failed to load component from module.
I’ve searched on Google and Bing. Viewed some posts and examples. Asked ChatGPT. No working solutions found.
Also I’m a bit curious that is NativeScript deprecated by the community? All {N} related questions on StackOverflow are quite old. The newest I can find were at least 2 year old. Are people using native instead or there is a newer framework that people more prefer to use?
Here are the modules names I tried:
- app/components/SelectCentre
- @/components/SelectCentre
- components/SelectCentre
- SelectCentre
- app/components/SelectCentre.vue
- @/components/SelectCentre.vue
- components/SelectCentre.vue
- SelectCentre.vue
This is where the navigation text is located.
app/components/Home.vue
<template>
<Page>
<FlexboxLayout dock="top" backgroundColor="#00667E" justifyContent="space-between" padding="5 10 10 10" style="font-weight: bold;">
<FlexboxLayout alignItems="center">
<Label class="fas" text.decode="" color="white" fontSize="12" />
<Label color="white" text="CENTRE1" marginLeft="10" />
</FlexboxLayout>
<Label color="white" text="Change Centre" style="text-decoration: underline;" @tap="navigateToSelectCentre" />
</FlexboxLayout>
</Page>
</template>
<script>
export default {
data() {
return {};
},
methods: {
navigateToSelectCentre(event) {
const page = event.object.page;
const frame = page.frame;
console.log(page)
console.log(frame)
frame.navigate({
moduleName: 'components/SelectCentre',
clearHistory: true,
});
},
},
};
</script>
I want successfully navigate to the targeted page. Great appreciation!