How does elementUI click a checkbox to let input hide it?

how to let input display when clicking on a group, click on individual input to hide, (and how to get the value entered by input)

 <el-radio-group v-model="ruleForm.nature" :change="change">
       <el-radio label="" ></el-radio>
       <el-radio label=""></el-radio>
       <el-input></el-input>
 </el-radio-group>

Thank you for inviting ~

// html
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.4.1/lib/index.js"></script>
<div id="app">
<template>
  <el-radio-group v-model="radio2" @change="change">
    <el-radio :label="1"></el-radio>
    <el-radio :label="2"></el-radio>
    <el-input v-model="inputValue" v-if="radio2 !== 1"></el-input>
  </el-radio-group>
</template>
</div>
// css
@import url("//unpkg.com/element-ui@2.4.1/lib/theme-chalk/index.css");
// JS
var Main = {
    data () {
      return {
        radio2: 1,
        inputValue: 'Rowboat'
      };
    },
    methods: {
        change(val){
          console.log(val, 'val');
        console.log(this.inputValue, 'input');
      },
    }
  }
var Ctor = Vue.extend(Main)
new Ctor().$mount('-sharpapp')

have a look at ide/forms.html" rel=" nofollow noreferrer > vue document-form input binding and elementUI document .

you can implement a single selection group by combining the el-radio-group element and the child element el-radio. Bind the label model in el-radio-group, and set the label in el-radio. There is no need to bind variables to each VMI. In addition, it also provides a change event to respond to changes, which passes in a parameter value.
I wrote with the case on the elementUI document. It can be accessed normally after climbing the wall.

change events are shown or hidden by id judgment or literal judgment

Menu