airyland / vux

Mobile UI Components based on Vue & WeUI
https://vux.li
MIT License
17.59k stars 3.71k forks source link

tabbar 组件使用的问题 #497

Closed 317365887 closed 8 years ago

317365887 commented 8 years ago

根据中文文档说明使用底部导航的功能,参考https://vuxjs.gitbooks.io/vux/content/layout/tabbar.html地址代码

界面不显示,JS报错为:“Uncaught TypeError: Cannot set property 'selected' of undefined”

airyland commented 8 years ago

上代码,谢谢。

317365887 commented 8 years ago
<router-view></router-view>
<div>
  <tabbar>
    <tabbar-item>
      <img slot="icon" src="https://o84lhz5xo.qnssl.com/master/src/assets/demo/icon_nav_button.png">
      <span slot="label">Wechat</span>
    </tabbar-item>
    <tabbar-item show-dot>
      <img slot="icon" src="https://o84lhz5xo.qnssl.com/master/src/assets/demo/icon_nav_msg.png">
      <span slot="label">Message</span>
    </tabbar-item>
    <tabbar-item selected>
      <img slot="icon" src="https://o84lhz5xo.qnssl.com/master/src/assets/demo/icon_nav_article.png">
      <span slot="label">Explore</span>
    </tabbar-item>
    <tabbar-item>
      <img slot="icon" src="https://o84lhz5xo.qnssl.com/master/src/assets/demo/icon_nav_cell.png">
      <span slot="label">News</span>
    </tabbar-item>
  </tabbar>
</div>
317365887 commented 8 years ago

代码就你是 文档里面那个 我直接复制的 什么都没改

317365887 commented 8 years ago

image

airyland commented 8 years ago

版本什么的也要说明吧

317365887 commented 8 years ago

不好意思,第一次用你的VUX。 版本0.1.3-rc9

airyland commented 8 years ago

完整一点的,包括 import 的代码呢

317365887 commented 8 years ago

image

airyland commented 8 years ago

嗯。。。路径似乎都是错的吧。

airyland commented 8 years ago
// import from dist
import Tabbar from 'vux/dist/components/tabbar'
import Tabbar from 'vux/dist/components/tabbar-item'

// or import from src
import { Tabbar, TabbarItem } from 'vux/src/components/tabbar'
317365887 commented 8 years ago

恩 我懂了, 谢谢了 , 真是打扰你了 。原来是dist 和src 引用的问题, 我一直在看src里面的东西

airyland commented 8 years ago

也是文档没有及时更新导致的。过些天会全部更新一遍。