提交 873141ba 编写于 作者: D DCloud_LXH

chore: 处理 warning

上级 a4b9d0a6
...@@ -20,18 +20,20 @@ ...@@ -20,18 +20,20 @@
methods: { methods: {
// @ts-ignore // @ts-ignore
_change(e : RadioGroupChangeEvent) { _change(e : RadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => { const selected = this.items.find((item: ItemType) : boolean => {
return item.name === e.detail.value as string return item.name === e.detail.value
}) }) as ItemType | null
this.current = selected?.value as number if (selected !== null) {
this.current = selected.value
this.$emit('change', this.current) this.$emit('change', this.current)
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '当前选中:' + selected?.name, title: '当前选中:' + selected.name,
}) })
} }
} }
} }
}
</script> </script>
<template> <template>
......
...@@ -48,10 +48,6 @@ ...@@ -48,10 +48,6 @@
this.showClearIcon = false this.showClearIcon = false
this.$emit('confirm', this.getValue(this.inputClearValue)) this.$emit('confirm', this.getValue(this.inputClearValue))
}, },
// @ts-ignore
confirm(e : InputConfirmEvent) {
// this.$emit('confirm', this.getValue(e.detail.value))
},
blur() { blur() {
this.showClearIcon = false this.showClearIcon = false
}, },
...@@ -85,8 +81,7 @@ ...@@ -85,8 +81,7 @@
</view> </view>
</view> </view>
<view class="uni-input-wrapper input-wrapper"> <view class="uni-input-wrapper input-wrapper">
<input class="uni-input" :type="inputType" :value="inputClearValue" :placeholder="title" @input="input" <input class="uni-input" :type="inputType" :value="inputClearValue" :placeholder="title" @input="input" @blur="blur" @focus="focus" />
@confirm="confirm" @blur="blur" @focus="focus" />
<image class="input-wrapper_image" src="/static/icons/clear.png" v-if="showClearIcon" @click="clearIcon"> <image class="input-wrapper_image" src="/static/icons/clear.png" v-if="showClearIcon" @click="clearIcon">
</image> </image>
</view> </view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册