Browse Source

修改Indicator.vue使用render渲染时,点击事件不生效

pull/19/head
zyronon 4 years ago
parent
commit
fcddbd46d7
  1. 4
      src/components/Indicator.vue
  2. 12
      src/pages/me/Uploader.vue

4
src/components/Indicator.vue

@ -59,7 +59,9 @@ export default { @@ -59,7 +59,9 @@ export default {
this.tabTexts.map((item, index) => {
return (
<div className={this.currentSlideItemIndex === index ? 'active tab' : 'tab'}
style={{width: this.tabStyleWidth}}>
style={{width: this.tabStyleWidth}}
onClick={e => this.changeIndex(index)}
>
< span> {item}</span>
</div>
)

12
src/pages/me/Uploader.vue

@ -155,6 +155,7 @@ @@ -155,6 +155,7 @@
</div>
</div>
<Indicator
ref="Indicator"
name="videoList"
tabStyleWidth="50%"
:tabRender="tabRender"
@ -223,10 +224,14 @@ export default { @@ -223,10 +224,14 @@ export default {
tabRender: () => {
return (
<div className="tabs" ref="tabs">
<div className={this.contentIndex === 0 ? 'active tab' : 'tab'} style="width:50%">
<div className={this.contentIndex === 0 ? 'active tab' : 'tab'}
onClick={e => this.changeIndicatorIndex(0)}
style="width:50%">
<span>作品 {this.localAuthor.video_count}</span>
</div>
<div className={this.contentIndex === 1 ? 'active tab' : 'tab'} style="width:50%">
<div className={this.contentIndex === 1 ? 'active tab' : 'tab'}
onClick={e => this.changeIndicatorIndex(1)}
style="width:50%">
<span>喜欢</span>
<img src={require('../../assets/img/icon/components/follow/lock.png')} alt=""/>
</div>
@ -372,6 +377,9 @@ export default { @@ -372,6 +377,9 @@ export default {
bus.on('baseSlide-end', () => this.canScroll = true)
},
methods: {
changeIndicatorIndex(index) {
this.$refs.Indicator.changeIndex(index)
},
async getAuthor() {
this.changeIndex(0, null)
// let res = await this.$api.user.author({id: this.author.id})

Loading…
Cancel
Save