修改Indicator.vue使用render渲染时,点击事件不生效
This commit is contained in:
parent
ccaf2f5aaa
commit
fcddbd46d7
@ -59,7 +59,9 @@ export default {
|
|||||||
this.tabTexts.map((item, index) => {
|
this.tabTexts.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<div className={this.currentSlideItemIndex === index ? 'active tab' : 'tab'}
|
<div className={this.currentSlideItemIndex === index ? 'active tab' : 'tab'}
|
||||||
style={{width: this.tabStyleWidth}}>
|
style={{width: this.tabStyleWidth}}
|
||||||
|
onClick={e => this.changeIndex(index)}
|
||||||
|
>
|
||||||
< span> {item}</span>
|
< span> {item}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -155,6 +155,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Indicator
|
<Indicator
|
||||||
|
ref="Indicator"
|
||||||
name="videoList"
|
name="videoList"
|
||||||
tabStyleWidth="50%"
|
tabStyleWidth="50%"
|
||||||
:tabRender="tabRender"
|
:tabRender="tabRender"
|
||||||
@ -223,10 +224,14 @@ export default {
|
|||||||
tabRender: () => {
|
tabRender: () => {
|
||||||
return (
|
return (
|
||||||
<div className="tabs" ref="tabs">
|
<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>
|
<span>作品 {this.localAuthor.video_count}</span>
|
||||||
</div>
|
</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>
|
<span>喜欢</span>
|
||||||
<img src={require('../../assets/img/icon/components/follow/lock.png')} alt=""/>
|
<img src={require('../../assets/img/icon/components/follow/lock.png')} alt=""/>
|
||||||
</div>
|
</div>
|
||||||
@ -372,6 +377,9 @@ export default {
|
|||||||
bus.on('baseSlide-end', () => this.canScroll = true)
|
bus.on('baseSlide-end', () => this.canScroll = true)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeIndicatorIndex(index) {
|
||||||
|
this.$refs.Indicator.changeIndex(index)
|
||||||
|
},
|
||||||
async getAuthor() {
|
async getAuthor() {
|
||||||
this.changeIndex(0, null)
|
this.changeIndex(0, null)
|
||||||
// let res = await this.$api.user.author({id: this.author.id})
|
// let res = await this.$api.user.author({id: this.author.id})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user