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">
    
    <ul>
      <li v-for="(input, index) in inputs">
        <input type="text" v-model="input.one"> - {{ input.one }}  
        <input type="text" v-model="input.two"> - {{ input.two }}
        <span v-show="input.video">
            <input type="text" v-model="input.video">
        </span>
        <a v-on:click="addVideo(index);" style="cursor: pointer">Add Video element</a><br>
        <button @click="deleteRow(index)">Delete</button>
      </li>
    </ul>
    
    <button @click="addRow">Add row</button>
    
  </div>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
  
</body>
</html>
 
const app = new Vue({
  
  el: '#app',
  
  data: {
    inputs: []
  },
  
  methods: {
    addRow() {
      this.inputs.push({
        one: '',
        two: ''
      })
    },
    addVideo (index) {
      this.inputs[index].video = ' '
      this.$forceUpdate()
    },
    deleteRow(index) {
      this.inputs.splice(index,1)
    }
  }
  
})
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers