[Bug Report] Slider中的List数据异步加载,无数据时也无法通过v-show隐藏该控件
- Lingua principale
- Vue
- Stelle
- 17.5k
- Fork
- 3.6k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### VUX version
2.9.4
### OS/Browsers version
Windows 10 / Chrome 74
### Vue version
2.6.10
### Code
```html
Template:
data:
banners: null
method: //异步获取banner
var self = this
axios.get('banners').then(data => {
self.banners = data.map(item => {
return { img: item.img, url: item.url, title: item.name }
})
})
```
### Steps to reproduce
按代码逻辑异步获取banner图片
### What is Expected?
1、有图的情况banners.length>0,显示slider组件
2、无图的情况,不显示silder组件
### What is actually happening?
不显示组件,但F12调试时发现:
1、banner取到了3条值,组件的html代码拼装有
2、vux-swiper的style有height:0px,如果我们手动改为100px,slider工作正常
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with the provided Vue reproduction using , v-show, and asynchronously populated banners. Check how the slider handles its initial null or empty list and subsequent updates; done means a populated list renders at the expected height and an empty list remains hidden without breaking the component.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100