view加@click之后,用键盘方向键控制会看到有焦点在移动。怎么能取消禁用这种焦点
我想自己定义方向键控制其它东西,不要有这个焦点在动。
网页中我知道onfocus="this.blur()"
uniapp里怎么写。view好像没有@focus也没有blur
1***@qq.com
- 发布:2022-08-16 14:21
- 更新:2024-04-09 11:18
- 阅读:414
1***@qq.com (作者)
app端vue
<script>
import Topbar from '@/components/topbar.vue'
export default {
components: {
Topbar
},
data() {
return {
activeItem: 1,
runMode: ''
}
},
onShow() {
this.runMode = this.$store.state.setting.mode
},
methods: {
back() {
uni.redirectTo({ url: '/pages/setting/index' })
},
changeMode(val) {
this.$store.commit('setSetting', { ...this.$store.state.setting, mode: val })
this.runMode = val
}
},
watch: {
"$store.state.keypress.stamp"() {
this.$store.commit('startHomeTimer')
const key = this.$store.state.keypress.value
if (key == 'LEFT')
this.back()
if (key == 'RIGHT') {
this.activeItem == 1 && this.changeMode('doctor')
this.activeItem == 2 && this.changeMode('default')
this.activeItem == 3 && this.changeMode('big')
}
if (key == 'UP' && this.activeItem > 1)
this.activeItem --
if (key == 'DOWN' && this.activeItem < 3)
this.activeItem ++
}
}
}
</script>
<template>
<view :class="$store.state.styleName">
<topbar />
<view class="setting-view">
<view class="title">检查模式</view>
<view class="setting-body" style="margin-bottom: 1500rpx;">
<uni-list>
<uni-list-item class="list-row" :class="{'list-row':true, 'active': activeItem==1}">
<template v-slot:header><text class="list-item">医生模式</text></template>
<template v-slot:footer><text class="list-item"><radio @click="changeMode('doctor')" :checked="runMode=='doctor'" color="#00a88e" /></text></template>
</uni-list-item>
<uni-list-item class="list-row" :class="{'list-row':true, 'active': activeItem==2}">
<template v-slot:header><text class="list-item">默认模式</text></template>
<template v-slot:footer><text class="list-item"><radio @click="changeMode('default')" :checked="runMode=='default'" color="#00a88e" /></text></template>
</uni-list-item>
<uni-list-item class="list-row" :class="{'list-row':true, 'active': activeItem==3}">
<template v-slot:header><text class="list-item">大屏幕模式</text></template>
<template v-slot:footer><text class="list-item"><radio @click="changeMode('big')" :checked="runMode=='big'" color="#00a88e" /></text></template>
</uni-list-item>
</uni-list>
</view>
</view>
<view class="nav-button-group">
<view class="button" @click="back">按
<image src="../../static/images/login_left_arrow.png" />
返回
</view>
<view class="button" @click="back">按
<image src="../../static/images/login_right_arrow.png" />
确认
</view>
</view>
</view>
</template>
1***@qq.com (作者)
看看我发的行不
2022-08-16 14:44