VueJs el-select
by Dede Brahma
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.3.9/lib/index.js"></script>
<div id="app">
<template>
<el-select v-model="value7" placeholder="Select">
<el-option-group v-for="group in options3" :key="group.label" :label="group.label">
<el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-option-group>
</el-select>
</template>
</div>
CSS
@import url("//unpkg.com/element-ui@2.3.9/lib/theme-chalk/index.css");
JavaScript
var Main = {
data() {
return {
options3: [{
label: 'Popular cities',
options: [{
value: 'Shanghai',
label: 'Shanghai'
}, {
value: 'Beijing',
label: 'Beijing'
}]
}, {
label: 'Indonesia',
options: [{
value: 'Jakarta',
label: 'Jakarta'
}, {
value: 'Bandung',
label: 'Bandung'
}]
}, {
label: 'Singapore',
options: []
}, {
label: 'Thailand',
options: []
}],
value7: ''
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')