vanilla-vue-ui 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,6 +44,10 @@ const props = defineProps({
|
|
|
44
44
|
trailingSlash: {
|
|
45
45
|
type: Boolean as PropType<boolean>,
|
|
46
46
|
default: false
|
|
47
|
+
},
|
|
48
|
+
hideWords: {
|
|
49
|
+
type: Array as PropType<string[]>,
|
|
50
|
+
default: () => []
|
|
47
51
|
}
|
|
48
52
|
})
|
|
49
53
|
|
|
@@ -65,10 +69,17 @@ type Page = {
|
|
|
65
69
|
href: string;
|
|
66
70
|
current: boolean;
|
|
67
71
|
};
|
|
68
|
-
|
|
69
72
|
const pages = ref<Page[]>([]);
|
|
70
73
|
// 表示対象だけに絞る(<li> ごと消えるので余白が生まれない)
|
|
71
|
-
const filteredPages = computed(() =>
|
|
74
|
+
const filteredPages = computed(() => {
|
|
75
|
+
const hideSet = props.hideWords.map(w => w.toLowerCase())
|
|
76
|
+
|
|
77
|
+
return pages.value.filter(p => {
|
|
78
|
+
if (p.name.length <= 1) return false
|
|
79
|
+
|
|
80
|
+
return !hideSet.includes(p.name.toLowerCase())
|
|
81
|
+
})
|
|
82
|
+
})
|
|
72
83
|
|
|
73
84
|
const router = useRouter();
|
|
74
85
|
const route = useRoute();
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import WTagLink from './WTagLink.vue';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WTagLink> = {
|
|
6
|
+
component: WTagLink,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof WTagLink>;
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
14
|
+
* See https://storybook.js.org/docs/api/csf
|
|
15
|
+
* to learn how to use render functions.
|
|
16
|
+
*/
|
|
17
|
+
export const Primary: Story = {
|
|
18
|
+
render: () => ({
|
|
19
|
+
components: { WTagLink },
|
|
20
|
+
template: '<WTagLink to="/to">content</WTagLink>',
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
:href="to"
|
|
4
|
+
class="
|
|
5
|
+
inline-flex items-center
|
|
6
|
+
h-8 pr-2 p-0
|
|
7
|
+
gap-2
|
|
8
|
+
rounded-full
|
|
9
|
+
bg-white
|
|
10
|
+
box-border border-2 border-black
|
|
11
|
+
shadow-sm
|
|
12
|
+
hover:shadow-md
|
|
13
|
+
hover:-translate-y-0.5
|
|
14
|
+
transition-all duration-150
|
|
15
|
+
relative
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
<span
|
|
19
|
+
class="
|
|
20
|
+
flex items-center justify-center
|
|
21
|
+
h-8 w-8
|
|
22
|
+
rounded-full
|
|
23
|
+
bg-orange-400
|
|
24
|
+
text-white
|
|
25
|
+
text-2xl
|
|
26
|
+
shrink-0
|
|
27
|
+
absolute -top-0.5 -left-1
|
|
28
|
+
border-2 border-black
|
|
29
|
+
"
|
|
30
|
+
>
|
|
31
|
+
#
|
|
32
|
+
</span>
|
|
33
|
+
|
|
34
|
+
<span
|
|
35
|
+
class="
|
|
36
|
+
text-gray-800
|
|
37
|
+
text-sm
|
|
38
|
+
font-medium
|
|
39
|
+
truncate
|
|
40
|
+
pl-8
|
|
41
|
+
"
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
44
|
+
</span>
|
|
45
|
+
</a>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
defineProps<{
|
|
50
|
+
to: string
|
|
51
|
+
}>()
|
|
52
|
+
</script>
|