mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 13:16:58 +00:00
fix(nc-gui): use computed value instead on inline condition
This commit is contained in:
@@ -12,8 +12,18 @@ const emits = defineEmits<{
|
||||
|
||||
const vModel = useVModel(props, 'value', emits)
|
||||
|
||||
const { isLoading } = toRefs(props)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const inputRef = ref()
|
||||
|
||||
const placeholder = computed(() => {
|
||||
return isLoading.value
|
||||
? 'Search...'
|
||||
: `${t('activity.searchProject').charAt(0).toUpperCase()}${t('activity.searchProject').slice(1).toLowerCase()}`
|
||||
})
|
||||
|
||||
const onKeydown = (e: KeyboardEvent) => {
|
||||
if (e.altKey && e.code === 'KeyB') {
|
||||
inputRef.value.input?.blur()
|
||||
@@ -29,11 +39,7 @@ const onKeydown = (e: KeyboardEvent) => {
|
||||
v-model:value="vModel"
|
||||
type="text"
|
||||
class="nc-base-search-input nc-input-border-on-value nc-input-shadow !h-8 !px-2.5 !py-1 !rounded-lg"
|
||||
:placeholder="
|
||||
isLoading
|
||||
? 'Search...'
|
||||
: `${$t('activity.searchProject').charAt(0).toUpperCase()}${$t('activity.searchProject').slice(1).toLowerCase()}`
|
||||
"
|
||||
:placeholder="placeholder"
|
||||
allow-clear
|
||||
:readonly="isLoading"
|
||||
@keydown="onKeydown"
|
||||
|
||||
Reference in New Issue
Block a user