<template><button type="primary" @click="click" icon="retweet" style="margin-left: 8px">{{message}}</button><div v-show="isShowChart">图表内容</div><div v-show="isShowTable">表格内容</div></template>export default {name: "DrivingStatistics",data() {return {isShowChart: true,isShowTable: false,message: "切换表格",}}methods: {//切换按钮click() {if (this.isShowChart) {this.message = "切换图表";} else {this.message = "切换表格";}this.isShowChart = !this.isShowChart;this.isShowTable = !this.isShowTable;}}}
1200字范文,内容丰富有趣,写作的好帮手!