<script>
  import Vue from 'vue';
  // import 'view-design/dist/styles/iview.css';
  import {Button} from 'view-design'
  import { oneOf } from 'view-design/src/utils/assist';
  import FunctionComponent from "../../../libs/utils/FunctionComponent";
  const prefixCls = 'ivu-btn';
  const _Button=Vue.extend({
    name:'HtBaseButton',
    extends:Button,
    props:{
      type: {
        validator (value) {
          return oneOf(value, ['default', 'primary','back','dashed', 'text', 'info', 'success', 'warning', 'error']);
        },
        default: 'default'
      },
      relief: {
        type: Boolean,
        default: false
      },
      selected: {
        type: Boolean,
        default: false
      },
      underline: {
        type: Boolean,
        default: false
      },
    },
    computed:{
      classes () {
        return [
          `${prefixCls}`,
          `${prefixCls}-${this.type}`,
          {
            [`${prefixCls}-long`]: this.long,
            [`${prefixCls}-${this.shape}`]: !!this.shape,
            [`${prefixCls}-${this.size}`]: this.size !== 'default',
            [`${prefixCls}-loading`]: this.loading != null && this.loading,
            [`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || !!this.customIcon || this.loading),
            [`${prefixCls}-ghost`]: this.ghost,
            [`relief`]: this.relief,
            [`selected`]: this.selected,
            [`underline`]:this.underline
          }
        ];
      },
    }
  });
  export default FunctionComponent(_Button,
          'ht-base-button', 'i',
          {
            preDispose(ctx) {
              if (ctx.props.icon) {
                this.props.icon = ' uedicon ht-base-' + ctx.props.icon;
              }
            }
          })
</script>




