ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.13k stars 14.64k forks source link

[Feature Request] el-tabs initialization, tab-bar no display. #13352

Closed ghost closed 6 years ago

ghost commented 6 years ago

Existing Component

Component Name

el-tabs tab-bar

Description

el-tabs initialization, tab-bar no display.

element-bot commented 6 years ago

Translation of this issue:

Existing Component yes

Component Name El-tabs tab-bar

Description El-tabs initialization, tab-bar no display.

georgyfarniev commented 6 years ago

Can you please explain what exactly you want to achieve? If you are looking to hide tab bar, you can add custom class to el-tabs and hide it child element with class el-tabs__header. You can read more information about class binding in vue here: https://vuejs.org/v2/guide/class-and-style.html

ghost commented 6 years ago

el-tabs每个nav的下划线 不显示 https://github.com/ElemeFE/element/blob/v2.4.9/packages/tabs/src/tab-bar.vue 注释以下代码 正常显示 if (!this.$parent.$refs.tabs) return {}; vue的版本2.5.2

ziyoung commented 6 years ago

@mopkq 是 bug 的话,请描述你的问题,提供重现问题的链接。如果是新功能,也描述清楚一点。

ghost commented 6 years ago

image @ziyoung @georgyfarniev 我是把源码 下载到本地 运行的

我猜是 tab-bar.vue源码if (!this.$parent.$refs.tabs) return {}; 这个问题 vue $refs 的说明 An important note about the ref registration timing: because the refs themselves are created as a result of the render function, you cannot access them on the initial render - they don’t exist yet! $refs is also non-reactive, therefore you should not attempt to use it in templates for data-binding.

ziyoung commented 6 years ago

无法重现。 image 你打开这个例子再验证一下: https://jsfiddle.net/hyLzc5dp/

Sept-i commented 2 years ago

高亮的线宽度是0,导致不显示,有什么方式能解决?,除了手动赋值宽度