我不知道如何使用Tab组件的Nativescript-vue后,上升的国家转录8.1.
下面的代码是Nativescript操场上的集体工作,但是在我的项目中出现了错误。
Home.vue
<StackLayout row="1">
<Tabs>
<TabStrip>
<TabStripItem>
<Label text="Newest" />
</TabStripItem>
<TabStripItem>
<Label text="Daily" />
</TabStripItem>
<TabStripItem>
<Label text="Weekly" />
</TabStripItem>
<TabStripItem>
<Label text="Monthly" />
</TabStripItem>
</TabStrip>
<TabContentItem>
<Label text="NEWEST test" />
</TabContentItem>
<TabContentItem>
<Label text="DAILY test" />
</TabContentItem>
<TabContentItem>
<Label text="WEEKLY test" />
</TabContentItem>
<TabContentItem>
<Label text="MONTHLY test" />
</TabContentItem>
</Tabs>
</StackLayout>我的控制台
CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
(UserNotifications) [com.apple.UserNotifications:Connections] [org.nativescript.firebasetest] Creating a user notification center
CONSOLE LOG: firebase.init done
NativeScript debugger has opened inspector socket on port 18183 for org.nativescript.firebasetest.
CONSOLE LOG: NativeScript-Vue has "Vue.config.silent" set to true, to see output logs set it to false.
CONSOLE LOG: TypeError: No known component for element Tabs.
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught TypeError: Cannot read property 'setAttribute' of undefined
at
setStyleScope(file: app/webpack:/firebasetest/node_modules/nativescript-vue/dist/index.js:8550:0)
...再生最小工程package.json
"dependencies": {
"@nativescript/core": "~8.1.1",
"@nativescript/firebase": "^11.1.3",
"@nativescript/theme": "~3.0.1",
"nativescript-vue": "~2.9.0"
},
"devDependencies": {
"@nativescript/ios": "8.1.0",
"@nativescript/webpack": "~5.0.0",
"nativescript-dev-typescript": "^0.10.0",
"nativescript-vue-template-compiler": "~2.9.0"
}我想这是偶然的,因为缺少任何软件包或插件。有人知道在Nativescript中使用Tabs的环境吗?
发布于 2022-09-22 21:55:45
8.0版发行说明中:
关于BottomNavigation和Tabs的重要注意事项
核心中的BottomNavigation和Tabs组件带来了Cocoapods,无论您的项目是否使用了Cocoapods。使用8.0,它们现在由社区提供,它们可以得到更集中的关注,而不受NativeScript核心更新的约束或阻碍。
现在可以通过@nativescript-community/ui-material-bottom-navigation获得
但是,api是相同的,但是组件名称可以交换到自述文件中的内容。
现在可通过@nativescript-社区/用户界面材料-选项卡获得。
这是更换的一滴水。
https://stackoverflow.com/questions/69959479
复制相似问题