npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sweet-modal-vue-3

v1.0.0

Published

SweetModal library for use with Vue 3, Nuxt 3

Downloads

1,409

Readme

SweetModal

This library is a fork from vue sweet modal for Vue 3 and Nuxt 3

Usage

Install SweetModal for Vue.js through npm:

npm install sweet-modal-vue-3

Install SweetModal for Vue.js through yarn:

yarn add sweet-modal-vue-3

Usage/Examples

For Vue 3

Use Globally

import { createApp } from 'vue'

const app = createApp({})

app.component(SweetModal)
app.mount('#app')

or

import SweetModal from 'sweet-modal-vue-3'
import App from './App.vue'

const app = createApp(App)

app.component(SweetModal)
app.mount('#app')

Use per Component

import { SweetModal, SweetModalTab } from 'sweet-modal-vue-3'

{
	components: {
		SweetModal,
		SweetModalTab
	}

	...
}

Using SFC and TypeScript

import { SweetModal, SweetModalTab } from 'sweet-modal-vue-3'

const modal = ref<InstanceType<typeof SweetMOdal> | null>(null)

const openModal = () => {
	modal.value?.open()
}

const closeModal = () => {
	modal.value?.close()
}

For Nuxt 3

Use Globally

import SweetModal from 'sweet-modal-vue-3'

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.component('SweetModal', SweetModal)
})

Using SFC and TypeScript

If you are experiencing a typescript error when using SweetModal in Nuxt 3, you can create a global type or custom type

  class SweetModalComponent extends Vue {
    open(tabId: string): void
    close(): void
  }

  type SweetModalType = InstanceType<typeof SweetModalComponent>
import { SweetModal, SweetModalTab } from 'sweet-modal-vue-3'

const modal = ref<SweetModalType>()

const openModal = () => {
	modal.value?.open()
}

const closeModal = () => {
	modal.value?.close()
}

Browser Compatibility

SweetModal should work in most major browsers:

  • Safari 9+
  • Firefox 20+
  • Chrome 20+
  • Opera 15+
  • Microsoft Edge

Contribution

  1. Fork the repository
  2. Run yarn
  3. Run yarn dev and start hacking. You can reach the example site at http://localhost:3000.
  4. When you're done, run one final yarn build command and commit your work for a pull request.

Guidelines

  • tabs for indentation, 1 tab = 4 spaces
  • camelCase method names
  • _camelCase for private methods
  • snake_case computed properties
  • snake_case data
  • kebab-case attributes
  • arrow functions if possible
  • be fully ES6 compliant!