Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-sonner

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-sonner - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

lib/assets/index.a4db810a.css

2

lib/vue-sonner.js
var me = Object.defineProperty;
var pe = (t, e, s) => e in t ? me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
var b = (t, e, s) => (pe(t, typeof e != "symbol" ? e + "" : e, s), s);
import "./assets/index.8b5e0269.css";
import "./assets/index.a4db810a.css";
import { defineComponent as j, openBlock as l, createElementBlock as f, createElementVNode as B, Fragment as L, renderList as ne, unref as r, ref as c, computed as p, onMounted as Z, watchEffect as R, onUnmounted as ae, normalizeClass as oe, normalizeStyle as ee, createVNode as he, createCommentVNode as w, createBlock as F, createTextVNode as ie, toDisplayString as U, resolveDynamicComponent as ye, useAttrs as ge } from "vue";

@@ -6,0 +6,0 @@ let H = 0;

{
"name": "vue-sonner",
"version": "0.3.1",
"version": "0.3.2",
"type": "module",

@@ -5,0 +5,0 @@ "author": "xiaoluoboding <xiaoluoboding@gmail.com>",

@@ -28,2 +28,4 @@ # Sonner for Vue

### For Vue 3
```html

@@ -33,11 +35,3 @@ <!-- App.vue -->

<Toaster />
<button
@click="
() => {
toast('My first toast')
}
"
>
Render a toast
</button>
<button @click="() => toast('My first toast')">Render a toast</button>
</template>

@@ -50,2 +44,67 @@

### For Nuxt 3
Define a nuxt plugin
```ts
// plugins/sonner.client.ts
import { Toaster, toast } from 'vue-sonner'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component('Toaster', Toaster)
return {
provide: {
toast
}
}
})
```
Use `Toaster` component and `$toast` function anywhere in the Vue SFC
```html
<!-- app.vue -->
<template>
<div>
<NuxtPage />
<Toaster position="top-right" />
<button @click="() => $toast('My first toast')">Render a toast</button>
</div>
</template>
<script setup lang="ts">
// alternatively, you can also use it here
const { $toast } = useNuxtApp()
</script>
```
Add the build transpile for `vue-sonner`
```ts
// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'
export default defineNuxtConfig({
...
build: {
transpile: ['vue-sonner']
}
})
```
### CDN Link
**EMS version**
```ts
https://cdn.jsdelivr.net/npm/vue-sonner/+esm
```
**UMD version**
```ts
https://www.unpkg.com/vue-sonner@0.3.1/lib/vue-sonner.umd.cjs
```
## Types

@@ -52,0 +111,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc