88 lines
1.4 KiB
Vue
88 lines
1.4 KiB
Vue
<template>
|
|
<u-input shape="circle" :placeholder="placeholder" :modelValue="value" :clearable="clearable"
|
|
:custom-style="inputStyle" :readonly="readonly"
|
|
:placeholder-style="`color: #999;${placeholderStyle};` " @change="handleChange"
|
|
>
|
|
<template v-if="suffix" #suffix>
|
|
<text class="font-26 clr-sub pl-10">{{suffix}}</text>
|
|
</template>
|
|
|
|
</u-input>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
computed: {
|
|
inputStyle(){
|
|
let sty1 = 'border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;'
|
|
this.isWhite && (sty1 += 'background-color: #fff;border: 1rpx solid #dadbde;')
|
|
return `${sty1};${this.customStyle};`
|
|
}
|
|
},
|
|
props: {
|
|
isWhite: {
|
|
default () {
|
|
return false
|
|
}
|
|
},
|
|
suffix: {
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
clearable: {
|
|
default () {
|
|
return false
|
|
}
|
|
},
|
|
readonly: {
|
|
default () {
|
|
return false
|
|
}
|
|
},
|
|
value: {
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
placeholder:{
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
customStyle:{
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
placeholderStyle:{
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
created() {
|
|
|
|
},
|
|
onHide() {
|
|
|
|
},
|
|
unmounted() {},
|
|
|
|
methods: {
|
|
handleChange(val){
|
|
this.$emit('change', val)
|
|
this.$emit('update:value', val)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
</style> |