<template>
  <div class="rt-line" :style="computedStyle"></div>
</template>

<script>
export default {
  name: 'RtLine',
  props: {
    color: {
      type: String,
      default: '#E8E8E8'
    },
    dashed: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    computedStyle() {
      if (this.dashed) {
        return {
          border: '1px dashed ' + this.color
        };
      }
      return {
        background: this.color,
        height: '1px'
      };
    }
  }
};
</script>

<style lang="less">
.rt-line {
  width: 100%;
  transform-origin: 0 0;
  transform: scaleY(0.5);
  margin: 10px 0;
}
</style>
