首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nativescript 8.1不承认<Tabs>

Nativescript 8.1不承认<Tabs>
EN

Stack Overflow用户
提问于 2021-11-14 00:59:00
回答 1查看 159关注 0票数 1

我不知道如何使用Tab组件的Nativescript-vue后,上升的国家转录8.1.

下面的代码是Nativescript操场上的集体工作,但是在我的项目中出现了错误。

Home.vue

代码语言:javascript
复制
     <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>

我的控制台

代码语言:javascript
复制
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

代码语言:javascript
复制
  "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的环境吗?

EN

回答 1

Stack Overflow用户

发布于 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-社区/用户界面材料-选项卡获得。

这是更换的一滴水。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69959479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档