input-ufo.vue 1.02 KB
<template>
  <CubeInput v-bind="$attrs" v-bind:value="value" v-on="inputListeners" :maxlength="8" class="input-number">
    <span slot="prepend">
      <slot name="prepend"></slot>
    </span>
    <span slot="append">
      <slot name="append"></slot>
    </span>
  </CubeInput>
</template>

<script>
import {Input} from 'cube-ui';

export default {
  name: 'InputUfo',
  props: ['value'],
  computed: {
    inputListeners() {
      return Object.assign({},
        this.$listeners,
        {
          input: (value) => {
            this.$emit('input', value);
          },
          blur: () => {
            this.$emit('blur', this.value);
          }
        }
      );
    }
  },
  methods: {
  },
  components: {CubeInput: Input}
};
</script>

<style lang="scss" scoped>
  .input-number {
    margin-bottom: 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
    font-size: 36px;

    &:after {
      border-radius: 20px;
      border-color: #f5f5f5;
    }

    /deep/ .cube-input-field {
      color: #000;
    }
  }
</style>