Skip to content

Fix Nuxt Composition #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2021
Merged

Fix Nuxt Composition #287

merged 1 commit into from
Oct 18, 2021

Conversation

Maronato
Copy link
Owner

Description

Currently it is not possible to use the built-in composition library with nuxt because the provide scope is not shared by nuxt's instance.
This PR creates a new export useToast from "vue-toastification/composition/nuxt":

// MyComponent.vue
// Import from vue-toastification/composition/nuxt, not vue-toastification/composition
import { useToast } from "vue-toastification/composition/nuxt";
// Then, in the setup method
  setup() {
    const toast = useToast()
    // Use it like you would use this.$toast
  }

It also fixes typing issues mentioned in #180

Related Issue

closes #180

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [ x New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Maronato Maronato added the Type: Bug Something isn't working label Oct 18, 2021
@codecov
Copy link

codecov bot commented Oct 18, 2021

Codecov Report

Merging #287 (dda988c) into main (1ad2724) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #287   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          436       436           
  Branches        89        89           
=========================================
  Hits           436       436           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ad2724...dda988c. Read the comment docs.

@Maronato Maronato merged commit 76c6188 into main Oct 18, 2021
@Maronato Maronato deleted the fix-nuxt-composition branch October 18, 2021 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant