Skip to content

Commit 5dfd9b9

Browse files
authored
Merge pull request #7 from kspace-trk/feat-nuxtlink-header
feat: aタグではなくNuxtLinkを使用
2 parents 4e0b423 + 5f033ba commit 5dfd9b9

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

dist/runtime/components/headers/SideHeader.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const handleMenuItemClick = (path, event) => {
5454
v-for="item in menuItems"
5555
:key="item.path"
5656
>
57-
<a
57+
<NuxtLink
5858
:href="item.path"
5959
:class="['menu-item', { active: props.currentPath === item.path }]"
6060
@click="handleMenuItemClick(item.path, $event)"
@@ -64,16 +64,16 @@ const handleMenuItemClick = (path, event) => {
6464
class="menu-item-icon"
6565
/>
6666
<p>{{ item.label }}</p>
67-
</a>
67+
</NuxtLink>
6868
</li>
6969
</ul>
7070
</div>
7171
<div
7272
v-if="bottomMenuItem"
7373
class="bottom-wrapper"
7474
>
75-
<a
76-
:href="bottomMenuItem.path"
75+
<NuxtLink
76+
:to="bottomMenuItem.path"
7777
:class="['menu-item', { active: props.currentPath === bottomMenuItem.path }]"
7878
@click="handleMenuItemClick(bottomMenuItem.path, $event)"
7979
>
@@ -82,7 +82,7 @@ const handleMenuItemClick = (path, event) => {
8282
class="menu-item-icon"
8383
/>
8484
<p>{{ bottomMenuItem.label }}</p>
85-
</a>
85+
</NuxtLink>
8686
</div>
8787
</div>
8888
</div>

dist/runtime/components/layouts/DashboardContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ const handleMenuItemClick = (path) => {
1111

1212
<template>
1313
<div id="default-layout">
14-
<SideHeader
14+
<KSSideHeader
1515
:logo-text="sideHeaderProps.logoText"
1616
:menu-items="sideHeaderProps.menuItems"
1717
:current-path="sideHeaderProps.currentPath"
1818
:bottom-menu-item="sideHeaderProps.bottomMenuItem"
1919
@menu-item-click="handleMenuItemClick"
2020
/>
2121
<div class="main-content">
22-
<TopHeader :title="topHeaderProps.title" />
22+
<KSTopHeader :title="topHeaderProps.title" />
2323
<slot />
2424
</div>
2525
</div>

playground/app.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ const _sideMenuItems = [
2020
<section>
2121
<h2>Buttons</h2>
2222
<div style="display: flex; gap: 10px; margin-bottom: 20px;">
23-
<MainButton
23+
<KSMainButton
2424
type="submit"
2525
text="送信ボタン"
2626
/>
27-
<MainButton
27+
<KSMainButton
2828
type="cancel"
2929
text="キャンセルボタン"
3030
/>
31-
<MainButton
31+
<KSMainButton
3232
type="submit"
3333
text="ローディング"
3434
:loading="true"
3535
/>
36-
<MainButton
36+
<KSMainButton
3737
type="submit"
3838
text="無効化"
3939
:disabled="true"
@@ -45,13 +45,13 @@ const _sideMenuItems = [
4545
<section>
4646
<h2>Forms</h2>
4747
<div style="max-width: 400px;">
48-
<InputField
48+
<KSInputField
4949
v-model="formData.name"
5050
label="名前"
5151
placeholder="名前を入力してください"
5252
:required="true"
5353
/>
54-
<TextareaField
54+
<KSTextareaField
5555
v-model="formData.description"
5656
label="説明"
5757
placeholder="説明を入力してください"
@@ -63,18 +63,18 @@ const _sideMenuItems = [
6363
<!-- Panels テスト -->
6464
<section>
6565
<h2>Panels</h2>
66-
<TextItem
66+
<KSTextItem
6767
:text="`ユーザー名: ${formData.name || '未入力'}`"
6868
/>
69-
<TextItem
69+
<KSTextItem
7070
:text="`説明: ${formData.description || '未入力'}`"
7171
/>
7272
</section>
7373

7474
<!-- Sections テスト -->
7575
<section>
7676
<h2>Sections</h2>
77-
<SectionTextWithLine text="セクション見出し" />
77+
<KSSectionTextWithLine text="セクション見出し" />
7878
</section>
7979
</div>
8080
</NuxtLayout>

playground/layouts/default.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { KSDashboardContainer } from '../../dist/runtime'
3+
24
const sideMenuItems = [
35
{ path: '/dashboard', label: 'ダッシュボード', icon: 'mdi:view-dashboard' },
46
{ path: '/users', label: 'ユーザー管理', icon: 'mdi:account-group' },
@@ -8,7 +10,7 @@ const sideMenuItems = [
810

911
<template>
1012
<div>
11-
<DashboardContainer
13+
<KSDashboardContainer
1214
:side-header-props="{
1315
logoText: '管理画面',
1416
menuItems: sideMenuItems,
@@ -17,6 +19,6 @@ const sideMenuItems = [
1719
:top-header-props="{ title: '管理画面' }"
1820
>
1921
<slot />
20-
</DashboardContainer>
22+
</KSDashboardContainer>
2123
</div>
2224
</template>

src/runtime/components/headers/SideHeader.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const handleMenuItemClick = (path: string, event?: Event): void => {
7777
v-for="item in menuItems"
7878
:key="item.path"
7979
>
80-
<a
80+
<NuxtLink
8181
:href="item.path"
8282
:class="['menu-item', { active: props.currentPath === item.path }]"
8383
@click="handleMenuItemClick(item.path, $event)"
@@ -87,16 +87,16 @@ const handleMenuItemClick = (path: string, event?: Event): void => {
8787
class="menu-item-icon"
8888
/>
8989
<p>{{ item.label }}</p>
90-
</a>
90+
</NuxtLink>
9191
</li>
9292
</ul>
9393
</div>
9494
<div
9595
v-if="bottomMenuItem"
9696
class="bottom-wrapper"
9797
>
98-
<a
99-
:href="bottomMenuItem.path"
98+
<NuxtLink
99+
:to="bottomMenuItem.path"
100100
:class="['menu-item', { active: props.currentPath === bottomMenuItem.path }]"
101101
@click="handleMenuItemClick(bottomMenuItem.path, $event)"
102102
>
@@ -105,7 +105,7 @@ const handleMenuItemClick = (path: string, event?: Event): void => {
105105
class="menu-item-icon"
106106
/>
107107
<p>{{ bottomMenuItem.label }}</p>
108-
</a>
108+
</NuxtLink>
109109
</div>
110110
</div>
111111
</div>

src/runtime/components/layouts/DashboardContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ const handleMenuItemClick = (path: string) => {
1616

1717
<template>
1818
<div id="default-layout">
19-
<SideHeader
19+
<KSSideHeader
2020
:logo-text="sideHeaderProps.logoText"
2121
:menu-items="sideHeaderProps.menuItems"
2222
:current-path="sideHeaderProps.currentPath"
2323
:bottom-menu-item="sideHeaderProps.bottomMenuItem"
2424
@menu-item-click="handleMenuItemClick"
2525
/>
2626
<div class="main-content">
27-
<TopHeader :title="topHeaderProps.title" />
27+
<KSTopHeader :title="topHeaderProps.title" />
2828
<slot />
2929
</div>
3030
</div>

0 commit comments

Comments
 (0)