javascript - Onsen UI Vue 可滑动的 Tabbar 不起作用

标签 javascript cordova vue.js vuejs2 onsen-ui

我用这个模板开始

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.0vue-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/

相关文章:

javascript - 当鼠标停止移动时执行 Jquery

android - 手机间隙 : Custom font is not working

android - Apache Cordova : can't get commons-codec

android - phonegap android 中的 "Camera cancelled"错误

vue.js - 无法在论坛中按类别过滤

vue.js - Vue Service Worker 离线无法在所有页面中工作

javascript - Jest Axios 测试在不应该通过的时候通过了

javascript - 获取线包围框的坐标

javascript - JQuery:向上滑动隐藏父级内的 div

html - 在 Element UI 中禁用点击关闭模式