JSFiddle - React, Tailwind, and code Playground

by asemahle

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.25/vue.js"></script>
<div id="app">
  <h4>You could move the data for the options into the vue instance</h4>
  <form>
    <div v-for="option in options">
      <input type="radio" name="rad" value="option1" @click="selectType(option)">${{ option.amount }}
    </div>
  </form>
    
  <pre>{{ order | json }}</pre>
</div>

JavaScript

var app = new Vue({
  el: '#app',

  data: {
    order: {},
    options: [
      { amount: 10, type: 'small'},
      { amount: 15, type: 'med'},
      { amount: 20, type: 'large'},
    ]
  },

  methods: {
    selectType: function(option) {
      this.order = option;
    }
  }
});