Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="app">
    <a-comp :data="datas[0]"></a-comp>
  </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
</body>
</html>
 
Vue.component('a-comp',{
  props: ['data'],
  data(){
    return {
      myData: {},
    }
  },
  template:`
  <div>{{myData.radio}}<br>
   <input type="radio" v-model="myData.radio" value="male">男生<br>
   <input type="radio" v-model="myData.radio" value="female">女生<br>
</div>
`,
  created(){
    this.myData = JSON.parse(JSON.stringify(this.data));
  }
});
var vm = new Vue({
  el:'#app',
  data:{
    datas:[{
      radio:'male',
    }]
  }
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers