🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

tv-modal

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tv-modal

programmatic modals for nuxtjs powered by tailwindcss

1.0.25
latest
Source
npm
Version published
Weekly downloads
312
-45.93%
Maintainers
1
Weekly downloads
 
Created
Source

Test Javascript

This requires Nuxt.js with the Tailwind CSS module

Quick Setup

  • Add the nuxt-tailvue dependency to your Nuxt.js project
npm install nuxt-tailvue
# OR
yarn add nuxt-tailvue
  • Add nuxt-tailvue to the modules section of nuxt.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') }

Keywords

vue

FAQs

Package last updated on 16 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts