emis-sapp/components/tpx-input/tpx-input.vue

83 lines
1.3 KiB
Vue
Raw Normal View History

2023-12-10 17:10:09 +00:00
<template>
2024-01-31 06:48:01 +00:00
<u-input shape="circle" :placeholder="placeholder" :modelValue="value" :clearable="clearable"
:custom-style="inputStyle"
: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>
2023-12-10 17:10:09 +00:00
</template>
<script>
export default {
2024-01-31 06:48:01 +00:00
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};`
}
},
2023-12-10 17:10:09 +00:00
props: {
2024-01-31 06:48:01 +00:00
isWhite: {
default () {
return false
}
},
suffix: {
default () {
return ''
}
},
clearable: {
default () {
return false
}
},
2023-12-10 17:10:09 +00:00
value: {
default () {
return ''
}
},
2023-12-11 09:44:17 +00:00
placeholder:{
default () {
return ''
}
},
2023-12-18 07:32:21 +00:00
customStyle:{
default () {
return ''
}
},
placeholderStyle:{
default () {
return ''
}
},
2023-12-10 17:10:09 +00:00
},
data() {
2024-01-22 01:55:30 +00:00
return {
}
2023-12-10 17:10:09 +00:00
},
created() {
},
onHide() {
},
2024-01-30 03:09:49 +00:00
unmounted() {},
2023-12-10 17:10:09 +00:00
methods: {
handleChange(val){
this.$emit('change', val)
this.$emit('update:value', val)
}
}
}
</script>
<style scoped lang="scss">
</style>