✨ feat (header): add button click functionality
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
const refSearchNav = {
|
||||
onClick: () => {
|
||||
console.log('onClick dari parent')
|
||||
// open filter modal
|
||||
},
|
||||
onInput: (val: string) => {
|
||||
console.log('>>>', val)
|
||||
onInput: (_val: string) => {
|
||||
// filter patient list
|
||||
},
|
||||
onClear: () => {
|
||||
// clear url param
|
||||
@@ -16,7 +16,7 @@ const hreaderPrep: HeaderPrep = {
|
||||
icon: 'bi bi-journal-check',
|
||||
addNav: {
|
||||
label: 'Tambah',
|
||||
onClick: () => (window.location.pathname = '/emergency/patient/add'),
|
||||
onClick: () => navigateTo('/patient/add'),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ const sidebar = {
|
||||
<Sidebar :collapsible="sidebar.collapsible" :side="sidebar.side" :variant="sidebar.variant">
|
||||
<SidebarHeader>
|
||||
<LayoutSidebarNavHeader :teams="teams" />
|
||||
<Search />
|
||||
<!-- <Search /> -->
|
||||
</SidebarHeader>
|
||||
<SidebarContent>
|
||||
<SidebarGroup v-for="(nav, indexGroup) in navMenu" :key="indexGroup">
|
||||
|
||||
@@ -13,6 +13,10 @@ function emitSearchNavClick() {
|
||||
function onInput(event: Event) {
|
||||
props.refSearchNav.onInput((event.target as HTMLInputElement).value)
|
||||
}
|
||||
|
||||
function btnClick() {
|
||||
props.prep.addNav?.onClick()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -33,6 +37,12 @@ function onInput(event: Event) {
|
||||
@input="onInput"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="prep.addNav" class="m-2 flex items-center">
|
||||
<Button size="md" class="rounded-md border border-gray-300 px-4 py-2 text-white sm:text-sm" @click="btnClick">
|
||||
<Icon name="i-lucide-plus" class="mr-2 h-4 w-4 align-middle" />
|
||||
{{ prep.addNav.label }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user