Open scottix opened 10 months ago
@scottix yes it is because you use both TabsPlugin
and BottomNavigation
which both use MDTabContentItem
.
The easy fix is to register components manually for one of them.
But the best solution would be to create an issue on vue3 repo. This shoud not be an error. At best a warning. But there is nothing wrong with doing this.
Ok I was able to work around the issue. Since I only need MDTabs that hasn't been registered
import { createApp } from 'nativescript-vue';
import { createPinia } from 'pinia';
import ButtonPlugin from '@nativescript-community/ui-material-button/vue';
import BottomNavigation from '@nativescript-community/ui-material-bottom-navigation/vue';
import CardViewPlugin from '@nativescript-community/ui-material-cardview/vue';
import { Tabs } from '@nativescript-community/ui-material-tabs';
import FloatingActionButtonPlugin from '@nativescript-community/ui-material-floatingactionbutton/vue';
import BottomNavFrame from './frames/BottomNavFrame.vue'
const pinia = createPinia();
const app = createApp(BottomNavFrame);
app.use(BottomNavigation)
.use(ButtonPlugin)
.use(CardViewPlugin)
.use(FloatingActionButtonPlugin)
.use(pinia);
app.registerElement('MDTabs', () => Tabs, {
model: {
prop: 'selectedIndex',
event: 'selectedIndexChange'
},
component: require('@nativescript-community/ui-material-tabs/vue/component').default
});
app.start();
One thing you could change on your install script for each registerElement
Vue.registerElement('MDTabStrip', () => TabStrip, { overwriteExisting: true });
@scottix great you got it to work
Getting an error when using nativescript-vue, ui-material-bottom-navigation, and ui-material-tabs
Which platform(s) does your issue occur on?
Tested on Emulator
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
tns plugin add @nativescript-community/ui-material-bottom-navigation
tns plugin add @nativescript-community/ui-material-tabs
Is there any code involved?
Seems like it is being registered twice or is there another way to include it?