input-ufo.vue
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<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: 32px;
&:after {
border-radius: 20px;
border-color: #f5f5f5;
}
/deep/ input::-webkit-input-placeholder {
font-size: 0.9rem;
padding: 0.2rem;
bottom: 0.4rem;
}
/deep/ .cube-input-field {
font-family: "DINAlternate-Bold", "ufofont", "PingFang-SC-Regular", sans-serif;
padding: 0.25rem;
font-size: 1rem;
color: #000;
}
}
</style>