前端代码:
- <template>
- <view>
- <image src="../../static/pari/buxihuan.png" v-show="showUpImg" @click="changeImg">
- </image>
- <image src="../../static/pari/dianshubuz.png" v-show="!showUpImg" @click="changeImg">
- </image>
- </view>
- </template>
生命周期
- export default {
- data() {
- return {
- showUpImg:true
- };
- },
- methods:{
- changeImg:function(){
- this.showUpImg = !this.showUpImg
- }
- },
- }
来源: http://www.bubuko.com/infodetail-3016102.html