import Status from '$mixins/status/const/status';
export default <LibMixins>{

    data(){
        return {
            buttonSize:{}
        }
    },

    computed:{
      size(){
          return {
              width: this.buttonSize.width || 0,
              height: this.buttonSize.height || 0
          }
      },
      width(){
          if (this.buttonStatus === Status.loading && this.loadingSize) {
              return this.size.height + 'px';
          } else {
              return this.size.width ?this.size.width+'px':'';
          }
      }
    },

    methods:{
        setSize(){
            this.buttonSize = {
                width: this.$refs.button.offsetWidth,
                height: this.$refs.button.offsetHeight
            };
        }
    },

    mounted() {
        this.setSize();
    },

}