tv-modal
This requires Nuxt.js with the Tailwind CSS module
Quick Setup
- Add the
nuxt-tailvuedependency to your Nuxt.js project
npm install nuxt-tailvue
# OR
yarn add nuxt-tailvue
- Add
nuxt-tailvueto themodulessection ofnuxt.config.js
{
modules: [
['nuxt-tailvue', {modal: true}],
]
}
- If you're using Purge, add this module to the content section of
tailwind.config.js
module.exports = {
content: [
'node_modules/tv-*/dist/tv-*.umd.min.js'
]
}
To use with Nuxt Windi CSS, add this module to your windi.config.js
import { defineConfig } from 'windicss/helpers'
export default defineConfig({
extract: {
include: ['node_modules/tv-*/dist/tv-*.umd.min.js'],
},
})
Usage
this.$modal.show({
type: 'danger',
title: 'This is the title property',
body: 'This is the body property. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eius aliquam laudantium explicabo pariatur iste dolorem animi vitae error totam.',
primary: {
label: 'Primary Action',
theme: 'red',
action: () => this.$toast.success('Primary Button clicked'),
},
secondary: {
label: 'Secondary Button',
theme: 'white',
action: () => this.$toast.info('Clicked Secondary'),
},
})
Options
type String
- Optional, Default: info
- Acceptable: success, info, danger, warning
title String
- Optional, Default: false
body String
- Required
primary Object
- Optional, Default: false
- Example: { label: 'Button Face', theme: 'indigo-light', action: () => console.log('clicked') }
secondary Object
- Optional, Default: false
- Example: { label: 'Button Face', theme: 'indigo-light', action: () => console.log('clicked') }
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.0.25 | MIT | |
| 1.0.24 | MIT | |
| 1.0.23 | MIT | |
| 1.0.22 | MIT | |
| 1.0.21 | MIT | |
| 1.0.20 | MIT | |
| 1.0.19 | MIT | |
| 1.0.18 | MIT | |
| 1.0.17 | MIT | |
| 1.0.16 | MIT | |
| 1.0.15 | MIT | |
| 1.0.14 | MIT | |
| 1.0.13 | MIT | |
| 1.0.12 | MIT | |
| 1.0.11 | MIT | |
| 1.0.10 | MIT | |
| 1.0.9 | MIT | |
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT |