Category "vue.js"

how to use color-thief in a vuejs context

I'm trying to import color-thief from NPM (https://github.com/lokesh/color-thief) like this: import ColorThief from 'colorthief' But when I call new ColorThi

vue-router redirect to default path issue

I want to default to a specific page when user navigates to the root path ie when used goes to myapp.com I want to redirect them to myapp.com/defaultpage My cu

How to fix navigator / window / document is undefined in Nuxt

I was trying to determined UserAgent and Retina info inside Nuxt application. But the application is throwing an error and showing navigatior / window is undefi

How to prerender a Vue3 application?

I try without success to apply a prerendering (or a SSG) to my Vue3 application to make it more SEO friendly. I found the vue-cli-plugin-prerender-spa, and when

How/Where to import ngVue in Angularjs?

We recently decided our transition of migrating our biggest project from AngularJS to Vue, but for now we are just giving it a try one by one. We would like to

What does slot mean in vue's render function

In vue, there is a slot option in render function, the document says "slot is the name of the slot, if this component is the child of another component". I can

VueJS - Object Props validation

In VueJS, how can I validate Object type props in order to ensure that the object has some specific fields defined? For example, i want to ensure that the user

How to use a git submodule with typescript code in a typescript project

I'm working on a VueJS project that uses different colors and some other things depending on a environment variable. These values are contained in another repos

Test suite failed to run import.meta.env.VITE_*

After adding the environment variable import.meta.env.VITE_* in my code, the tests with vue-test-utils started to fail, with the error: Jest suite failed to run

cant access json object stored in local storage [object Object] in vue.js

I have fieldObj which I need frequently. It comes from database. I want to store it in localStorage. below is the code I wrote which fetch fieldObj from databas

On Vue.js v-model does not keep the value when the user hits the back button

I have a form with checkboxes. When the user marks them as checked I add the value to a vue.js prop. If the user submits the form and then presses the back butt

Nuxt.js custom role middleware doesn't work when page refresh

I have a simple application with some pages that need to be protected if the connected user is not an administrator. I use the nuxt/auth package to handle the a

How to get slot props with render functions in Vue?

I'm trying to transform a Vue component I've made in a render function. Problem is I can't find a way to access the named slot props, like in the example: <t

The `/deep/` selector is not working using sass-loader in my VueJS application

In my Vue 2.6.10 webpack application I am trying to add SASS as our team wants to migrate our legacy application from LESS to SCSS. In my package.json I have in

Can't load Leaflet inside Vue component

I am trying to create a Leaflet map as a Vue component but I am having some difficult getting started. I installed Leaflet through npm Where am I going wrong?

How to access async store data in vue-router for usage in beforeEnter hook?

How is it possible to access store data in beforeEnter which is retrieved asynchronously via the store action? import store from './vuex/store'; store.dispatc

Running an Express server middleware alongside Nuxt

My endpoints aren't working, and most likely because the server on which express is isn't running correctly. I run my files with npm run dev and my express file

How do I set initial state in Vuex 2?

I am using Vue.js 2.0 and Vuex 2.0 for a small app. I am initializing the store in the 'created' life-cycle hook on the root Vue instance by calling an action t

Nuxt.js vuex store not persisted

I've got some strange issues with my Nuxt.js Setup. Some States in Store arent persistent, everytime I load another view, they went back to the default value. p

NextJS: How to correctly add firebase analytics to NextJS app

I have a react/nextjs app and I have firebase.js as follow: import firebase from 'firebase/app' import 'firebase/auth' import 'firebase/analytics' import 'fireb