wormsan / vue-lazyload-img

A plugin of vue for image lazyload(vue图片懒加载插件)
http://docs.gomeminus.com/vue-lazyload-img/test/bundle.html
MIT License
249 stars 52 forks source link

How do you install this? #1

Closed roblav96 closed 8 years ago

roblav96 commented 8 years ago
// warning: vue-router requires Vue 0.12.10+
import Vue from 'vue'
import VueRouter from '../../src'
import { configRouter } from './route-config'
require('es6-promise').polyfill()

// install router
Vue.use(VueRouter)

// create router
const router = new VueRouter({
  history: true,
  saveScrollPosition: true
})

// configure router
configRouter(router)

// boostrap the app
const App = Vue.extend(require('./app.vue'))
router.start(App, '#app')

How to install with this workflow?

wormsan commented 8 years ago

Accually it could not be used in webpack workflow, cause I recommend it to be use as a library. But Now I have fixed this problem, and I have published this plugin to npm. To work with this workflow, simply npm install vue-lazyload-img, and import "vue-lazyload-img", and Vue.use(Vue.lazyimg) ,then It will be worked. For more infomation, you could read the new updated README. Thanks for this Issue, if there's still any problem, just contact me.

roblav96 commented 8 years ago

too drunk to reply. in the am this will be solved. thank you kind sir