Skip to content

[新功能需求] 车牌键盘增加中英切换事件和英汉prop #1275

Description

@misterch

这个功能解决了什么问题?

在输入车牌时,输入完第一个汉语字符后,自动切换到英语键盘,不需要用户手动切换;
当用户点击车牌输入框的第一个输入框切换到汉语键盘,非第一个输入框切换到英语键盘;
也可以由用户自由切换英汉键盘

你期望的 API 是什么样子的?

<template>
  <wd-keyboard v-model:visible="visible" mode="car" @input="onInput" @delete="onDelete" v-model:lang="curLang"></wd-keyboard>
</template>

<script>
//车牌输入框下标
const inputIndex = ref(0)
const curLang = ref('zh')

const onInput = (val)=>{
  if(inputIndex.value>0){
    curLang.value= 'eng'
  }
  inputIndex.value++
  ......
}
const selectPlateInput = (idx)=>{
  curLang.value = idx>0?'eng':'zh'
}
</script>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions