我用这个模板开始
https://github.com/OnsenUI/vue-cordova-webpack
然后我添加了一个标签栏,它没问题,但是 swipeable 属性不起作用 当我运行代码时,我可以单击选项卡并且它可以工作但是滑动不起作用
我可以在温泉 ui 演示中滑动,这样我的浏览器就可以了
这是我的 Tabbar 组件
<template>
<v-ons-page>
<v-ons-toolbar>
<div class="center">{{ title }}</div>
</v-ons-toolbar>
<v-ons-tabbar
swipeable position="auto"
:tabs="tabs"
:visible="true"
:index.sync="activeIndex"
>
</v-ons-tabbar>
</v-ons-page>
</template>
<script>
import Dashboard from './components/dashboard.vue';
import Diary from './components/diary.vue';
export default {
data () {
return {
activeIndex: 0,
tabs: [
{
label: 'dash',
page: Dashboard,
icon: this.md() ? null : 'ion-ios-settings',
key: "Dashboard"
},
{
label: 'diar',
page: Diary,
icon: this.md() ? null : 'ion-ios-settings',
key: "Diary"
}
]
};
},
methods: {
md() {
return this.$ons.platform.isAndroid();
}
},
computed: {
title() {
return this.tabs[this.activeIndex].label;
}
}
};
</script>
最佳答案
确保您至少使用 onsenui@2.6.0
和 vue-onsenui@2.2.0
。变更日志 here .如果可能,请更新到最新版本。检查 package.json
文件并更改版本号,或者,如果您使用的是 yarn ,只需运行 yarn upgrade onsenui vue-onsenui
。
关于javascript - Onsen UI Vue 可滑动的 Tabbar 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46644086/