Comments (2)
I have no experience with storybook (I have plans to use for the next version of the docs), anyway, you can install the plugin normally? with the Vue.use(
syntax?
Ask because it's possible to install a single component but you should use the same syntax you use to install the library since the installation process is when the props are overridden, to do that you need to import the component with this path: vue-tailwind/dist/components/{componentName}
example import ComponentName from 'vue-tailwind/dist/components/ComponentName.umd.js'
So for your specific case, the component should be added like this:
import TButton from 'vue-tailwind/dist/components/TButton.umd.js'
Vue.use(TButton, {
fixedClasses: 'button',
variants: {
primary: 'is-primary'
}
})
Notice that this is not in the docs, the main reason is that I am not happy with the approach I followed and is something I want to change in the next version of the package that very likely will accept a syntax like the one you are using.
Let me know if that syntax helps you, I am very interested in making this library works with storybook
from vue-tailwind.
@alfonsobries the plugin works fine, it was a mistake on my end.
Instead of using the globally registered component in the story, I was importing the component and then using it.
The story should look like this if someone else faces this issue in future:
import { TButton } from 'vue-tailwind'
export default {
title: 'Example/Button',
component: TButton,
argTypes: {
variant: {
control: { type: 'select', options: ['', 'primary'] }
},
onClick: { action: 'click' }
}
}
const Template = (_args, { argTypes }) => ({
props: Object.keys(argTypes),
// The component is already globally registered and configured,
// do not register the component locally
// components: { TButton },
template: `
<t-button @click="onClick" v-bind="$props">
Button
</t-button>`
})
export const Primary = Template.bind({})
Primary.args = {
variant: 'primary'
}
from vue-tailwind.
Related Issues (20)
- Feature request in TRichSelect - Add button to close selector
- Bug with nested results for TRichSelect
- Provide ES build
- TRichSelect - Buttons in DropdownUp and DropdownDown do not register click in Safari
- How to display Datepicker only year?
- [help wanted] t-rich-select grouping options HOT 1
- How to blur T-rich-select dropdown upon select
- Dropdown without JavaScript
- <router-link>'s tag prop is deprecated
- Pagination in Rich Select HOT 3
- Semantic TCard (and others)
- not working with vueJS3
- Checkbox not working, value never changes HOT 2
- 🚨 [Important]: project status
- Header Modal Customize
- Variants don't work
- How use t-dropdown in file .tsx HOT 1
- Build for production with Vite? HOT 9
- Rich Select multiple placeholder not rendering
- Time in french
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-tailwind.