
<template>
	<span v-if="params.value">
		<Icon :type="config.type" :color="config.color" />
	</span>
</template>

<script>
import { Icon } from 'view-design'
const trueConfig = {
	type: 'md-checkmark',
	color: 'green'
};
const falseConfig = {
	type: 'md-close',
	color: 'red'
}
export default {
	name: 'boolean-cell',
	components: { Icon },
	computed: {
		config() {
			return ['1', true].includes(this.params.value) ? trueConfig : falseConfig
		}
	},
	data() {

	},
	beforeMount() {
		// this.column = this.params.colDef;
		//如果想要改变true和false的代值，需要在context里找到对应的原column
	},
}
</script>