<template>
	<mu-select  v-model="currentValue" full-width @change="changeValue" v-if="type=='role'">
		<mu-option v-for="(item,index) in list" :key="item.roleName" :label="item.roleName" :value="item.roleId"></mu-option>
	</mu-select>
	<mu-select  v-model="currentValue" full-width @change="changeValue" v-else>
		<mu-option v-for="item in list" :key="item.dicValue" :label="item.dicValue" :value="item.dicKey"></mu-option>
	</mu-select>
</template>

<script>
  import Vue from 'vue'
  import { Select } from 'muse-ui';
  Vue.use(Select);
	import {
		postApi,
		getApi
	} from "../../../api/commonApi"
	export default {
		name: "lbButton",
		props: {
			value: {
				type: [String, Number], // 必须要使用value
				default: '',
			},
			label: {},
			list:{
			},
			type:{}
		},
		data() {
			return {
				currentValue: '',

			}
		},
		mounted() {
			this.currentValue = this.value;
		},
		components: {

		},
		watch: {
			value(newVal) {
				this.currentValue = newVal;
			}

		},
		mounted() {

		},
		created() {},
		methods: {
			changeValue() {
				this.$emit("input", this.currentValue);
				this.$emit("change", this.currentValue);
			}
		}
	}
</script>

<style scoped>
	@import 'lbSelect.css';
</style>
