-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create VTag component #3137
Create VTag component #3137
Changes from 1 commit
afbd407
00cd837
c8df0a0
44f6545
3726c7c
1b5e998
84c6d64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||
<template> | ||||
<VButton | ||||
as="VLink" | ||||
size="small" | ||||
variant="filled-gray" | ||||
class="label-bold" | ||||
:href="href" | ||||
>{{ title }}</VButton | ||||
> | ||||
</template> | ||||
|
||||
<script lang="ts"> | ||||
import { defineComponent } from "@nuxtjs/composition-api" | ||||
|
||||
import VButton from "~/components/VButton.vue" | ||||
|
||||
export default defineComponent({ | ||||
name: "VTag", | ||||
components: { VButton }, | ||||
props: { | ||||
title: { type: String }, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This prop has to be |
||||
href: { | ||||
type: String, | ||||
required: true, | ||||
}, | ||||
}, | ||||
}) | ||||
</script> | ||||
|
||||
<style scoped></style> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Canvas, Meta, Story } from "@storybook/addon-docs" | ||
|
||
import VTag from "~/components/VTag/VTag.vue" | ||
|
||
export const Template = (args) => ({ | ||
template: `<VTag v-bind="args"/>`, | ||
components: { VTag }, | ||
setup() { | ||
return { args } | ||
}, | ||
}) | ||
|
||
<Meta title="Components/VTag" component={VTag} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This story should have args and argTypes set up: this will allow us to set the title and the href to test in the storybook. You can see examples of how to set this up in other |
||
|
||
<Canvas> | ||
<Story name="default">{Template.bind({})}</Story> | ||
</Canvas> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are trying to move away from
@nuxtjs/composition-api
wherever possible: this will make the transition to Nuxt 3 easier. This is why we only use thedefineComponent
imported from@nuxtjs/composition-api
onpage
s. On a component like this, it's better to import it fromvue
.