vue-lazy-background-images icon indicating copy to clipboard operation
vue-lazy-background-images copied to clipboard

Error on npm run dev

Open pongoman opened this issue 8 years ago • 9 comments

After installing and importing :

import Vue from 'vue' import App from './App' import VueLazyBackgroundImages from 'vue-lazy-background-images'

Vue.component('lazy-background', VueLazyBackgroundImages)

I get the following error

I managed to fix this by changing "main": "main.js" to "main": "VueLazyBackgroundImage.vue" in package.json.

pongoman avatar Dec 26 '16 18:12 pongoman

Are you using vue2?

darrynten avatar Dec 29 '16 07:12 darrynten

Yes, vue-cli project webpack template

pongoman avatar Dec 29 '16 11:12 pongoman

I see.

By the looks of things you're trying to import VueLazyBackgroundImages and it's actually called VueLazyBackgroundImage without the s at the end.

This totally conflicts with the documentation, so very valid, will fix it.

darrynten avatar Dec 30 '16 07:12 darrynten

Okay I am stuck, don't know where to put all things together, i'm new to Vue 2. Do i put this in App.vue? <lazy-background // binding :image-source="backgroundImage" :loading-image="loadingImage" // direct link or path error-image="/img/error.png" image-class="img-responsive" >

m2ura avatar Feb 16 '17 21:02 m2ura

This is my VueLazyBackground.vue file.

m2ura avatar Feb 16 '17 21:02 m2ura

instead: import VueLazyBackgroundImages from 'vue-lazy-background-images'

use: import VueLazyBackgroundImage from 'vue-lazy-background-images/VueLazyBackgroundImage'

solved for me!

waLplanet avatar Mar 22 '18 12:03 waLplanet

Thanks @waLplanet , that worked for me. Strange that it doesnt match the docs @darrynten

jackkitley avatar Apr 19 '18 08:04 jackkitley

`import VueLazyBackgroundImage from 'vue-lazy-background-images/VueLazyBackgroundImage'

export default { components: { countdownTimer, VueLazyBackgroundImage },`

jackkitley avatar Apr 19 '18 08:04 jackkitley

Don't use

import VueLazyBackgroundImage from 'vue-lazy-background-images

Instead of that use like this

import VueLazyBackgroundImage from 'vue-lazy-background-images/VueLazyBackgroundImage'

azizullahsaeidi avatar Aug 12 '20 09:08 azizullahsaeidi