JSFiddle - React, Tailwind, and code Playground

by asemahle

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script>
<div id="app">
  <select v-model="selected">
    <optgroup :label="group.label" v-for="group in optgroups">
      <option :value="option" v-for="option in group.options">{{ option }}</option>
    </optgroup>
  </select>
</div>

JavaScript

var app = new Vue({
	el: '#app',
  
  data: {
  	selected: '',
    maxNum: 5,
    optgroups: [
      { label: 'A', options: ['a', 'b']},
      { label: 'B', options: ['c', 'd']}
    ]
  }
})