ElementUI of el-radio radio button click the submit button to change the state function

<template>
  <div>
    <el-radio-group v-model="radioTreaty" @change="agreeChange">
        <el-radio label="1" border>不同意</el-radio>
        <el-radio label="2" border>同意</el-radio>
    </el-radio-group>
    <el-button type="primary"  :disabled="btnstatus" style="width: 180px; " Submit Order></el-button>
  </div>
</template>

<script>
  export default {
      data() {
          return {
            radioTreaty: '1',
            btnstatus:true,
          }
      },
      methods: {
          agreeChange:function(val){
            let that = this 
            that.btnstatus=(val==='1')?true:false;
          }
      }
  }
</script>

<style>
  .el-radio-group{
    display:block;
    margin-bottom:20px;
  }
</style>

 

 

 Reference URL: https: //blog.csdn.net/xfcy1990/article/details/90438549

 

Guess you like

Origin www.cnblogs.com/webBirdsFly/p/11535459.html