JSFiddle - React, Tailwind, and code Playground
by leopoldthecuber
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
<template>
<el-select v-model="value5" multiple :multiple-limit="2" @change="handleChange">
<el-option v-for="item in options" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
</div>
SCSS
@import url("//unpkg.com/element-ui/lib/theme-default/index.css");
Babel + JSX
var Main = {
methods: {
handleChange(val) {
console.log(val)
}
},
data() {
return {
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
value5: []
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')