feat: #8410 added new feature to module searchbar #1272
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix-front#1272
Loading…
Reference in New Issue
No description provided.
Delete Branch "8410-improveModuleSearchbar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -177,0 +185,4 @@
})
const searching = ref(false)
moduleArrays.value.find((module) => {
console.log(module.title);
Quitar
@ -174,6 +175,35 @@ function normalize(text) {
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase();
}
const searchModule = () => {
Estás haciendo 2 bucles, pasar a 1. Respuesta de copilot:
@ -177,0 +197,4 @@
const globalLocale = t(label);
return globalLocale;
};
const searchingValue = ref(false);
Las variables ponlas juntas y las funciones lo mismo.
@ -177,0 +198,4 @@
return globalLocale;
};
const searchingValue = ref(false);
function searchingFunction(evt) {
Solo gastas esta función en 1 sitio, es innecesaria.
@ -177,0 +193,4 @@
})
}
const getLocale = (label) => {
Solo gastas esta función en 1 sitio, es innecesaria.
@ -189,2 +219,4 @@
dense
autofocus
@keyup.enter.stop="searchModule(search)"
@update:model-value="searchingFunction($event)"
en lugar de usar una función, puedes hacer searchingVal = !!$event; que te devuelve el valor booleano. Y te ahorras líneas.
Al tabular, puedes cambiar de item y acceder a otro, sin embargo, aparece resaltado el primer item.
@ -336,6 +368,9 @@ function normalize(text) {
.header {
color: var(--vn-label-color);
}
.searched{
Sería un mejor enfoque intentar forzar el foco del item.
.
@ -175,2 +177,4 @@
.toLowerCase();
}
const searchModule = () => {
const searching = ref(false);
No es necesario que sea ref, usar variable normal.
arreglado
@ -188,3 +194,4 @@
filled
dense
autofocus
@keyup.enter.stop="search ? searchModule(search) : ''"
llamar solo a la fn searchModule()
@keyup.enter.stop="searchModule()"
.
@ -182,16 +187,18 @@ function normalize(text) {
<template v-if="$route?.matched[1]?.name === 'Dashboard'">
<QItem class="q-pb-md">
<VnInput
ref="searchInput"
si no se usa quitar
quitado
.