<template>
	<div>
		<treeselect v-model="value" :multiple="multiple" :options="options" placeholder = "请选择时间节点" noResultsText = "没有结果"/>
	</div>
</template>

<script>
	// import the component
  	import Treeselect from '@riophae/vue-treeselect'
    // import the styles
    import '@riophae/vue-treeselect/dist/vue-treeselect.css'
	export default {
		props: ["multiple","options"],
		data: function(){
			return {
				"value": undefined
			}
		},
		components: { 
			Treeselect 
		},
		methods: {
			/**
			 * 获取选中的值
			 */
			getValue: function(){
				return this.value;
			},
			
			/**
			 * 设置值
			 * @param {Object} value
			 */
			setValue: function(value){
				this.value = value;
			}
		},
		
		watch: {
			"value" : function(curVal, oldVal){
				this.$emit("valueChanged", curVal);
			}
		}
	}
</script>

<style>
</style>