<template>
<div>
<el-switch>
<el-option v-for="item in list"
:key="item.event"
:label="item.label"
:value="item.event"
@change="choose(item)">
</el-switch>
<p v-if="money">物质</p>
<p v-if="dream">梦想</p>
</div>
</template>
<script>
export default {
data(){
retrun{
list:[
{event:'1',lable:'物质'},
{event:'2',lable:'梦想'}
],
money:false,
dream:false
};
},
methods:{
choose(item){
if(item.event==='1'){
this.money=true
this.dream=false
}else{
this.dream=true
this.money=false
}
}
}
}
</script>