Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

kt trigger input field event


respect to you all

I have a question
There is a search input in the header field, when a text is written to it, I want to show the components in search.vue, but while doing this
A click operation is required to show the content part in search.vue. I want to show that component when there is an event in the input field in my header component, not with the click operation.

this toggle area

<template v-slot:toggle>
<!--begin::Search-->
<div
id="kt_header_search"
class="d-flex align-items-stretch"
data-kt-menu-target="#kt-search-menu"
data-kt-menu-trigger="click"
data-kt-menu-attach="parent"
data-kt-menu-placement="bottom-end"
data-kt-menu-flip="bottom"

>
<!--begin::Search toggle-->
<!-- <div class="d-flex align-items-center" id="kt_header_search_toggle" >-->
<!-- <div class="btn-search">-->
<!-- <button class="text-white border-transparent bg-transparent">-->
<!-- <inline-svg src="/kobasis/icon/IconSearch.svg" />-->
<!-- Ba&Auml;&#159;&Auml;&plusmn;&Aring;&#159;&ccedil;&Auml;&plusmn; Ara-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
<div class="btn-search position-relative">
<div class="text-white border-transparent bg-transparent d-flex align-items-center">
<inline-svg src="/kobasis/icon/IconSearch.svg" />
<input
ref="inputRef"
v-model="search"
@input="searching($event)"
type="text"
name="search"
placeholder="Ba&Auml;&#159;&Auml;&plusmn;&Aring;&#159;&ccedil;&Auml;&plusmn; Ara"
class="bg-transparent text-white mx-1"

/>
<span v-if="loading" class="position-absolute top-50 end-0 translate-middle-y lh-0 mx-2">
<span class="spinner-border h-15px w-15px align-middle text-white"></span>
</span>
</div>
</div>
<!--end::Search toggle-->
</div>
<!--end::Search-->
</template>
<pre/>

this content area

<pre>
<template v-slot:content>
<!--begin::Menu-->
<div
class="menu menu-sub menu-sub-dropdown menu-column p-7 w-325px w-md-375px"
data-kt-menu="true"
id="kt-search-menu"
>
<!--begin::Wrapper-->
<div>
<!--begin::Form-->
<!-- <form class="w-100 position-relative mb-3" autocomplete="off">-->
<!-- &lt;!&ndash;begin::Icon&ndash;>-->
<!-- <span-->
<!-- class="svg-icon svg-icon-2 svg-icon-lg-1 svg-icon-gray-500 position-absolute top-50 translate-middle-y ms-0"-->
<!-- >-->
<!-- <inline-svg src="/media/icons/duotune/general/gen021.svg" />-->
<!-- </span>-->
<!-- &lt;!&ndash;end::Icon&ndash;>-->

<!-- &lt;!&ndash;begin::Input&ndash;>-->
<!-- <input-->
<!-- ref="inputRef"-->
<!-- v-model="search"-->
<!-- @input="searching($event)"-->
<!-- type="text"-->
<!-- class="form-control form-control-flush ps-10"-->
<!-- name="search"-->
<!-- placeholder="Ba&Auml;&#159;&Auml;&plusmn;&Aring;&#159;&ccedil;&Auml;&plusmn; Ara..."-->
<!-- />-->
<!-- &lt;!&ndash;end::Input&ndash;>-->

<!-- &lt;!&ndash;begin::Spinner&ndash;>-->
<!-- <span v-if="loading" class="position-absolute top-50 end-0 translate-middle-y lh-0 me-1">-->
<!-- <span class="spinner-border h-15px w-15px align-middle text-gray-400"></span>-->
<!-- </span>-->
<!-- &lt;!&ndash;end::Spinner&ndash;>-->

<!-- &lt;!&ndash;begin::Reset&ndash;>-->
<!-- <span-->
<!-- v-show="search.length && !loading"-->
<!-- @click="reset()"-->
<!-- class="btn btn-flush btn-active-color-primary position-absolute top-50 end-0 translate-middle-y lh-0"-->
<!-- >-->
<!-- <span class="svg-icon svg-icon-2 svg-icon-lg-1 me-0">-->
<!-- <inline-svg src="/media/icons/duotune/arrows/arr061.svg" />-->
<!-- </span>-->
<!-- </span>-->
<!-- &lt;!&ndash;end::Reset&ndash;>-->

<!-- &lt;!&ndash;begin::Toolbar&ndash;>-->
<!-- &lt;!&ndash;end::Toolbar&ndash;>-->
<!-- </form>-->
<!--end::Form-->
<div v-if="search.length < 2">Ba&Auml;&#159;&Auml;&plusmn;&Aring;&#159;&ccedil;&Auml;&plusmn; ismini yaz&Auml;&plusmn;n&Auml;&plusmn;z</div>
<!--begin::Separator-->
<div class="separator border-gray-200 mb-6"></div>
<!--end::Separator-->
<Results :data="bagiscilar" v-if="state === "results""></Results>
<!-- <Main v-else-if="state === "main""></Main>-->
<Empty v-else-if="state === "empty""></Empty>
</div>
<!--end::Wrapper-->
</div>
<!--end::Menu-->
</template>


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Kadir,

Thank you for reaching out to us.

It sounds like you are trying to display different menu content depending on the value of the field. To achieve this you can use Vue conditional rendering directives v-if and v-else.

For more info, you can refer to Vue 3 official documentation.
https://vuejs.org/guide/essentials/conditional.html

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(