ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ![](https://box.kancloud.cn/7db616bc3259f31053a6c9fe9606b426_941x345.PNG) ## 左右按钮点击切换 ``` <view class="nav"> <image src="{{isLatest?noLeft:yesLeft}}" bind:tap="onLeft"/> <text>{{title}}</text> <image src="{{isFirst?noRight:yesRight}}" bind:tap="onRight" /> </view> ``` ``` .nav{ background: #f7f7f7; height: 80rpx; display: flex ; justify-content: space-between; align-items: center; border-radius: 10rpx; margin: 30rpx; font-size: 25rpx; } .nav image{ width: 80rpx; height: 80rpx; } ``` ``` Component({ /** * 组件的属性列表 */ properties: { title:String, isLatest:Boolean, isFirst:Boolean, }, /** * 组件的初始数据 */ data: { noLeft:'image/triangle.dis@left.png', noRight:'image/triangle.dis@right.png', yesLeft:'image/triangle@left.png', yesRight:'image/triangle@right.png' }, /** * 组件的方法列表 */ methods: { onLeft(){ if(!this.properties.isLatest){ this.triggerEvent("next",{}) } }, onRight(){ if(!this.properties.isFirst){ this.triggerEvent("previous",{}) } } } }) ```