Skip to content
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

Integrate epic-spinner in nuxtjs project #43

Open
jeydi243 opened this issue Aug 31, 2020 · 7 comments
Open

Integrate epic-spinner in nuxtjs project #43

jeydi243 opened this issue Aug 31, 2020 · 7 comments

Comments

@jeydi243
Copy link

Hi everyone!

Can someone help me to integrate it in nuxtjs!
Thank you!

@tokidoki11
Copy link

I used nuxt with typescript, It is just simple as install and import

JS version should be the same

@axieum
Copy link

axieum commented Jan 16, 2021

Doesn't appear to work -

<script lang="ts">
import Vue from 'vue';
import { AtomSpinner } from 'epic-spinners';

export default Vue.extend({
  components: {
    AtomSpinner,
  },
});
</script>

image

@stevenferrer
Copy link

stevenferrer commented Mar 1, 2021

You can do something like below.

<script>
let HollowDotsSpinner = null

if (process.client) {
  HollowDotsSpinner = require('epic-spinners').HollowDotsSpinner
}

export default Vue.extend({
  components: {
    HollowDotsSpinner,
  },
});
</script>

@mamaoag
Copy link

mamaoag commented Apr 20, 2021

I manage to solve this issue by registering the desired spinner component globally. I am using Nuxt.js v2 for reference.

  1. Create a plugin plugin/<filename>.js
    With the contents:
import Vue from 'vue'
import { <spinner> } from 'epic-spinners'

Vue.component(component_name, <spinner>) 
  1. Import the plugin on the plugins option in nuxt.config.js

@yauri-io
Copy link

yauri-io commented May 2, 2021

For Nuxt SSR, Just follow the usage example in the home page

  // To use minified css and js files instead of .vue single file components:
 import 'epic-spinners/dist/lib/epic-spinners.min.css'
 import {AtomSpinner} from 'epic-spinners/dist/lib/epic-spinners.min.js'

@vinosamari
Copy link

I seem to be experiencing the same issue even after using the plugins workaround by @mamaoag. Also, no changes with the <client-only tag.

@galaxyblur
Copy link

galaxyblur commented Apr 5, 2023

I'm on nuxt 2.* with nuxt-bridge and this works totally fine for me (static build though):

import { OrbitSpinner } from 'epic-spinners';

export default {
  components: {
    OrbitSpinner,
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants