【发布时间】:2018-03-20 12:34:06
【问题描述】:
我用这个模板开始
https://github.com/OnsenUI/vue-cordova-webpack
然后我添加了一个标签栏,它可以,但可滑动属性不起作用 当我运行代码时,我可以单击选项卡及其工作,但滑动不起作用
我可以在温泉 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>
【问题讨论】:
标签: javascript cordova vue.js vuejs2 onsen-ui