<template>
  <el-tag type="success" v-if="value == 'FINISH'" size="mini">订单完成</el-tag>
  <el-tag type="warning" v-else-if="value == 'CANCEL'" size="mini">订单取消</el-tag>
  <el-tag type="info" v-else-if="value == 'WAIT_CONFIRM'" size="mini">创建成功，等待入库确认</el-tag>
  <el-tag type="danger" v-else-if="value == 'FAILURE'" size="mini">订单失败</el-tag>
</template>

<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
@Component
export default class TagState extends Vue {
  value:any=null;

  @Prop()
  propConfig: any

  @Prop()
  propValue?:any

  @Prop()
  parentValue:any

  @Watch('propValue')
  propValueChange(v:any){
    this.setValue(v);
  }

  mounted(){
    if(this.propValue){
      this.setValue(this.propValue)
    }
  }

  setValue(v:any){
    this.value = v;
  }
}
</script>

<style lang="scss" scoped>

</style>