storybook icon indicating copy to clipboard operation
storybook copied to clipboard

How to add documentation associated with my component ?

Open Kamsou opened this issue 2 years ago • 0 comments

Hello guys,

Projet "nuxt-edge": "^2.16.0-27358576.777a4b7f",

I have a pagination.stories.js file in my project and I try to add some documentation in the "Docs" tab, but when I install the @storybook/addon-docs lib the tab disappears. I tried to create an additional mdx file with my markdown doc in pagination.stories.mdx but nothing happens. Any ideas?

Capture d’écran 2023-01-02 à 15 26 51

pagination.stories.js

import LtPagination from '@/components/LtPagination/index.vue'

export default {
    title: 'Components/Pagination',
    component: LtPagination,
    argTypes: {},
}

const Template = (args) => ({
    components: {
        LtPagination,
    },
    setup: () => ({ args }),
    template: `<LtPagination v-bind="args" />`,
})

export const Default = Template.bind({})
Default.args = {
    totalItems: 200,
    itemsPerPage: 20,
    maxVisiblePages: 3,
}

export const Medium = Template.bind({})
Medium.args = {
    totalItems: 15000,
    itemsPerPage: 20,
    maxVisiblePages: 3,
}

export const Maximum = Template.bind({})
Maximum.args = {
    totalItems: 500000,
    itemsPerPage: 20,
    maxVisiblePages: 3,
}

Kamsou avatar Jan 02 '23 14:01 Kamsou