import { computed } from "vue" export function computedStateStyle() { /** * 状态颜色回显 */ const stateStyle = computed(() => { return function(state){ if(state){ if(state.value === 'pending'){ return { color: 'rgba(243, 167, 63, 1)', backgroundColor: 'rgba(243, 167, 63, 0.16)' }; } else if (state.value === 'handler'){ return { color: 'rgba(0, 108, 249, 1)', backgroundColor: 'rgba(0, 108, 249, 0.16)' }; } else if (state.value === 'close'){ return { color: 'rgba(73, 184, 86, 1)', backgroundColor: 'rgba(73, 184, 86, 0.16)' }; } else { return {} } }else{ return {}; } } }) return { stateStyle }; }