扫一扫分享
vue-multiselect一款为 Vue.js 打造的下拉组件,支持单选和多选和标签,支持 Ajax,支持服务端渲染
通过npm安装vue-multiselect
npm install vue-multiselect
使用
<template>
<div>
<multiselect
v-model="selected"
:options="options">
</multiselect>
</div>
</template>
<script>
import Multiselect from 'vue-multiselect'
export default {
components: { Multiselect },
data () {
return {
selected: null,
options: ['list', 'of', 'options']
}
}
}
</script>
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
手机预览