├── static
├── .gitkeep
├── img
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── 6.jpg
│ ├── 7.jpg
│ ├── 8.jpg
│ ├── 9.jpg
│ ├── 10.jpg
│ ├── 11.jpg
│ ├── 12.jpg
│ ├── 13.jpg
│ ├── 14.jpg
│ ├── 15.jpg
│ ├── 16.jpg
│ ├── 17.jpg
│ ├── 18.jpg
│ ├── 19.jpg
│ └── 20.jpg
├── css
│ └── reset.css
└── mock
│ ├── only-text.json
│ ├── data-change.json
│ ├── data-router-link.json
│ └── data.json
├── .gitignore
├── .npmignore
├── config
├── prod.env.js
├── dev.env.js
└── index.js
├── demo
├── static
│ ├── img
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ ├── 5.jpg
│ │ ├── 6.jpg
│ │ ├── 7.jpg
│ │ ├── 8.jpg
│ │ ├── 9.jpg
│ │ ├── 10.jpg
│ │ ├── 11.jpg
│ │ ├── 12.jpg
│ │ ├── 13.jpg
│ │ ├── 14.jpg
│ │ ├── 15.jpg
│ │ ├── 16.jpg
│ │ ├── 17.jpg
│ │ ├── 18.jpg
│ │ ├── 19.jpg
│ │ └── 20.jpg
│ ├── css
│ │ ├── reset.css
│ │ ├── app.befdc0535133fb008f520586dae6d62d.css
│ │ └── app.befdc0535133fb008f520586dae6d62d.css.map
│ ├── js
│ │ ├── manifest.3ad1d5771e9b13dbdad2.js
│ │ ├── manifest.3ad1d5771e9b13dbdad2.js.map
│ │ ├── app.ff2dec037ff7f4c9baa9.js
│ │ └── app.ff2dec037ff7f4c9baa9.js.map
│ └── mock
│ │ ├── only-text.json
│ │ ├── data-change.json
│ │ ├── data-router-link.json
│ │ └── data.json
└── index.html
├── .editorconfig
├── .babelrc
├── .postcssrc.js
├── src
├── router
│ └── index.js
├── main.js
├── vue-waterfall-easy
│ ├── webpack.config.js
│ ├── components
│ │ └── alink.vue
│ ├── vue-waterfall-easy.vue
│ └── script
│ │ └── vueWaterfallEasy.js
└── App.vue
├── index.html
├── VUE-CLI-README.md
├── LICENSE
├── package.json
├── README-CN.md
└── README.md
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | npm-debug.log
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | npm-debug.log
5 | static/
6 | docs/
--------------------------------------------------------------------------------
/static/img/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/1.jpg
--------------------------------------------------------------------------------
/static/img/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/2.jpg
--------------------------------------------------------------------------------
/static/img/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/3.jpg
--------------------------------------------------------------------------------
/static/img/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/4.jpg
--------------------------------------------------------------------------------
/static/img/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/5.jpg
--------------------------------------------------------------------------------
/static/img/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/6.jpg
--------------------------------------------------------------------------------
/static/img/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/7.jpg
--------------------------------------------------------------------------------
/static/img/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/8.jpg
--------------------------------------------------------------------------------
/static/img/9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/9.jpg
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/static/img/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/10.jpg
--------------------------------------------------------------------------------
/static/img/11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/11.jpg
--------------------------------------------------------------------------------
/static/img/12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/12.jpg
--------------------------------------------------------------------------------
/static/img/13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/13.jpg
--------------------------------------------------------------------------------
/static/img/14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/14.jpg
--------------------------------------------------------------------------------
/static/img/15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/15.jpg
--------------------------------------------------------------------------------
/static/img/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/16.jpg
--------------------------------------------------------------------------------
/static/img/17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/17.jpg
--------------------------------------------------------------------------------
/static/img/18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/18.jpg
--------------------------------------------------------------------------------
/static/img/19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/19.jpg
--------------------------------------------------------------------------------
/static/img/20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/static/img/20.jpg
--------------------------------------------------------------------------------
/demo/static/img/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/1.jpg
--------------------------------------------------------------------------------
/demo/static/img/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/2.jpg
--------------------------------------------------------------------------------
/demo/static/img/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/3.jpg
--------------------------------------------------------------------------------
/demo/static/img/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/4.jpg
--------------------------------------------------------------------------------
/demo/static/img/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/5.jpg
--------------------------------------------------------------------------------
/demo/static/img/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/6.jpg
--------------------------------------------------------------------------------
/demo/static/img/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/7.jpg
--------------------------------------------------------------------------------
/demo/static/img/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/8.jpg
--------------------------------------------------------------------------------
/demo/static/img/9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/9.jpg
--------------------------------------------------------------------------------
/demo/static/img/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/10.jpg
--------------------------------------------------------------------------------
/demo/static/img/11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/11.jpg
--------------------------------------------------------------------------------
/demo/static/img/12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/12.jpg
--------------------------------------------------------------------------------
/demo/static/img/13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/13.jpg
--------------------------------------------------------------------------------
/demo/static/img/14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/14.jpg
--------------------------------------------------------------------------------
/demo/static/img/15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/15.jpg
--------------------------------------------------------------------------------
/demo/static/img/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/16.jpg
--------------------------------------------------------------------------------
/demo/static/img/17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/17.jpg
--------------------------------------------------------------------------------
/demo/static/img/18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/18.jpg
--------------------------------------------------------------------------------
/demo/static/img/19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/19.jpg
--------------------------------------------------------------------------------
/demo/static/img/20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/vue-waterfall-easy/HEAD/demo/static/img/20.jpg
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 |
4 | Vue.use(Router)
5 | export default new Router({
6 | routes: [
7 | {
8 | path: '/test',
9 | name: 'test',
10 | component: { name: 'test',template:'
test test test test test test '}
11 | },
12 | ]
13 | })
14 |
--------------------------------------------------------------------------------
/static/css/reset.css:
--------------------------------------------------------------------------------
1 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin:0; padding:0; }
2 |
3 | body { color:#555; font-size:14px; font-family: Verdana, Arial, Helvetica, sans-serif; }
4 |
5 | a { color:#555; text-decoration:none; }
6 |
7 | li{list-style:none;}
8 |
9 | .clearfix:after {content: "."; display: block; height:0; clear:both; visibility: hidden;}
10 | .clearfix { *zoom:1; }
--------------------------------------------------------------------------------
/demo/static/css/reset.css:
--------------------------------------------------------------------------------
1 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin:0; padding:0; }
2 |
3 | body { color:#555; font-size:14px; font-family: Verdana, Arial, Helvetica, sans-serif; }
4 |
5 | a { color:#555; text-decoration:none; }
6 |
7 | li{list-style:none;}
8 |
9 | .clearfix:after {content: "."; display: block; height:0; clear:both; visibility: hidden;}
10 | .clearfix { *zoom:1; }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | vue-waterfall-easy
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import router from './router'
6 | import Promise from 'promise-polyfill'
7 | // To add to window
8 | if (!window.Promise) {
9 | window.Promise = Promise
10 | }
11 | /* eslint-disable no-new */
12 | new Vue({
13 | el: '#app',
14 | router,
15 | template: ' ',
16 | components: { App }
17 | })
18 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 | vue-waterfall-easy
--------------------------------------------------------------------------------
/VUE-CLI-README.md:
--------------------------------------------------------------------------------
1 | # vue_origin
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
--------------------------------------------------------------------------------
/src/vue-waterfall-easy/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var webpack = require('webpack')
3 | module.exports = {
4 | entry: path.resolve(__dirname, './vue-waterfall-easy.vue'),
5 | output: {
6 | path: path.resolve(__dirname, 'script'),
7 | filename: 'vueWaterfallEasy.js',
8 | libraryTarget:'umd',
9 | library: 'vueWaterfallEasy',
10 | libraryExport: "default", // 不设置此项目,那么只能test.default中访问
11 | },
12 |
13 | module: {
14 | rules: [
15 | {
16 | test: /\.vue$/,
17 | loader: 'vue-loader',
18 | },
19 | ]
20 | },
21 | plugins:[
22 | new webpack.optimize.UglifyJsPlugin()
23 | ]
24 | };
25 |
--------------------------------------------------------------------------------
/src/vue-waterfall-easy/components/alink.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | a.alink(:href="to",target="_blank")
12 | slot
13 |
14 |
15 |
16 |
32 |
--------------------------------------------------------------------------------
/demo/static/js/manifest.3ad1d5771e9b13dbdad2.js:
--------------------------------------------------------------------------------
1 | !function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a",
6 | "main": "./src/vue-waterfall-easy/script/vueWaterfallEasy.js",
7 | "license": "MIT",
8 | "repository": {
9 | "type": "git",
10 | "url": "git+https://github.com/lfyfly/vue-waterfall-easy.git"
11 | },
12 | "scripts": {
13 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
14 | "start": "npm run dev",
15 | "build": "node build/build.js",
16 | "pack": "webpack --config src/vue-waterfall-easy/webpack.config.js"
17 | },
18 | "devDependencies": {
19 | "autoprefixer": "^7.1.2",
20 | "axios": "^0.18.0",
21 | "babel-core": "^6.22.1",
22 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
23 | "babel-loader": "^7.1.1",
24 | "babel-plugin-syntax-jsx": "^6.18.0",
25 | "babel-plugin-transform-runtime": "^6.22.0",
26 | "babel-plugin-transform-vue-jsx": "^3.5.0",
27 | "babel-preset-env": "^1.3.2",
28 | "babel-preset-stage-2": "^6.22.0",
29 | "chalk": "^2.0.1",
30 | "copy-webpack-plugin": "^4.0.1",
31 | "css-loader": "^0.28.0",
32 | "extract-text-webpack-plugin": "^3.0.0",
33 | "file-loader": "^1.1.4",
34 | "friendly-errors-webpack-plugin": "^1.6.1",
35 | "html-webpack-plugin": "^2.30.1",
36 | "node-notifier": "^5.1.2",
37 | "node-sass": "^4.14.1",
38 | "optimize-css-assets-webpack-plugin": "^3.2.0",
39 | "ora": "^1.2.0",
40 | "portfinder": "^1.0.13",
41 | "postcss-import": "^11.0.0",
42 | "postcss-loader": "^2.0.8",
43 | "postcss-url": "^7.2.1",
44 | "promise-polyfill": "^7.1.2",
45 | "pug": "^2.0.3",
46 | "rimraf": "^2.6.0",
47 | "sass-loader": "^7.0.1",
48 | "semver": "^5.3.0",
49 | "shelljs": "^0.7.6",
50 | "uglifyjs-webpack-plugin": "^1.1.1",
51 | "url-loader": "^0.5.8",
52 | "vue": "^2.5.16",
53 | "vue-loader": "^13.3.0",
54 | "vue-router": "^3.0.1",
55 | "vue-style-loader": "^3.0.1",
56 | "vue-template-compiler": "^2.5.2",
57 | "webpack": "^3.6.0",
58 | "webpack-bundle-analyzer": "^2.9.0",
59 | "webpack-dev-server": "^2.9.1",
60 | "webpack-merge": "^4.1.0"
61 | },
62 | "engines": {
63 | "node": ">= 6.0.0",
64 | "npm": ">= 3.0.0"
65 | },
66 | "browserslist": [
67 | "> 1%",
68 | "last 2 versions",
69 | "not ie <= 8"
70 | ]
71 | }
72 |
--------------------------------------------------------------------------------
/static/mock/data.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "src": "./static/img/1.jpg",
4 | "href": "https://www.baidu.com",
5 | "info": "一些图片描述文字"
6 | },
7 | {
8 | "src": "./static/img/2-.jpg",
9 | "href": "https://www.baidu.com",
10 | "info": "一些图片描述文字"
11 | },
12 | {
13 | "src": "./static/img/3.jpg",
14 | "href": "https://www.baidu.com",
15 | "info": "一些图片描述文字"
16 | },
17 | {
18 | "src": "./static/img/4.jpg",
19 | "href": "https://www.baidu.com",
20 | "info": "一些图片描述文字"
21 | },
22 | {
23 | "src": "./static/img/5.jpg",
24 | "href": "https://www.baidu.com",
25 | "info": "一些图片描述文字"
26 | },
27 | {
28 | "src": "./static/img/6.jpg",
29 | "href": "https://www.baidu.com",
30 | "info": "一些图片描述文字"
31 | },
32 | {
33 | "src": "./static/img/7.jpg",
34 | "href": "https://www.baidu.com",
35 | "info": "一些图片描述文字"
36 | },
37 | {
38 | "src": "./static/img/8.jpg",
39 | "href": "https://www.baidu.com",
40 | "info": "一些图片描述文字"
41 | },
42 | {
43 | "src": "./static/img/9.jpg",
44 | "href": "https://www.baidu.com",
45 | "info": "一些图片描述文字"
46 | },
47 | {
48 | "src": "./static/img/10.jpg",
49 | "href": "https://www.baidu.com",
50 | "info": "一些图片描述文字"
51 | },
52 | {
53 | "src": "./static/img/11.jpg",
54 | "href": "https://www.baidu.com",
55 | "info": "一些图片描述文字"
56 | },
57 | {
58 | "src": "./static/img/12.jpg",
59 | "href": "https://www.baidu.com",
60 | "info": "一些图片描述文字"
61 | },
62 | {
63 | "src": "./static/img/13.jpg",
64 | "href": "https://www.baidu.com",
65 | "info": "一些图片描述文字"
66 | },
67 | {
68 | "src": "./static/img/14.jpg",
69 | "href": "https://www.baidu.com",
70 | "info": "一些图片描述文字"
71 | },
72 | {
73 | "src": "./static/img/15.jpg",
74 | "href": "https://www.baidu.com",
75 | "info": "一些图片描述文字"
76 | },
77 | {
78 | "src": "./static/img/16.jpg",
79 | "href": "https://www.baidu.com",
80 | "info": "一些图片描述文字"
81 | },
82 | {
83 | "src": "./static/img/17.jpg",
84 | "href": "https://www.baidu.com",
85 | "info": "一些图片描述文字"
86 | },
87 | {
88 | "src": "./static/img/18.jpg",
89 | "href": "https://www.baidu.com",
90 | "info": "一些图片描述文字"
91 | },
92 | {
93 | "src": "./static/img/19.jpg",
94 | "href": "https://www.baidu.com",
95 | "info": "一些图片描述文字"
96 | },
97 | {
98 | "src": "./static/img/20.jpg",
99 | "href": "https://www.baidu.com",
100 | "info": "一些图片描述文字"
101 | }
102 | ]
103 |
--------------------------------------------------------------------------------
/demo/static/mock/data.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "src": "./static/img/1.jpg",
4 | "href": "https://www.baidu.com",
5 | "info": "一些图片描述文字"
6 | },
7 | {
8 | "src": "./static/img/2-.jpg",
9 | "href": "https://www.baidu.com",
10 | "info": "一些图片描述文字"
11 | },
12 | {
13 | "src": "./static/img/3.jpg",
14 | "href": "https://www.baidu.com",
15 | "info": "一些图片描述文字"
16 | },
17 | {
18 | "src": "./static/img/4.jpg",
19 | "href": "https://www.baidu.com",
20 | "info": "一些图片描述文字"
21 | },
22 | {
23 | "src": "./static/img/5.jpg",
24 | "href": "https://www.baidu.com",
25 | "info": "一些图片描述文字"
26 | },
27 | {
28 | "src": "./static/img/6.jpg",
29 | "href": "https://www.baidu.com",
30 | "info": "一些图片描述文字"
31 | },
32 | {
33 | "src": "./static/img/7.jpg",
34 | "href": "https://www.baidu.com",
35 | "info": "一些图片描述文字"
36 | },
37 | {
38 | "src": "./static/img/8.jpg",
39 | "href": "https://www.baidu.com",
40 | "info": "一些图片描述文字"
41 | },
42 | {
43 | "src": "./static/img/9.jpg",
44 | "href": "https://www.baidu.com",
45 | "info": "一些图片描述文字"
46 | },
47 | {
48 | "src": "./static/img/10.jpg",
49 | "href": "https://www.baidu.com",
50 | "info": "一些图片描述文字"
51 | },
52 | {
53 | "src": "./static/img/11.jpg",
54 | "href": "https://www.baidu.com",
55 | "info": "一些图片描述文字"
56 | },
57 | {
58 | "src": "./static/img/12.jpg",
59 | "href": "https://www.baidu.com",
60 | "info": "一些图片描述文字"
61 | },
62 | {
63 | "src": "./static/img/13.jpg",
64 | "href": "https://www.baidu.com",
65 | "info": "一些图片描述文字"
66 | },
67 | {
68 | "src": "./static/img/14.jpg",
69 | "href": "https://www.baidu.com",
70 | "info": "一些图片描述文字"
71 | },
72 | {
73 | "src": "./static/img/15.jpg",
74 | "href": "https://www.baidu.com",
75 | "info": "一些图片描述文字"
76 | },
77 | {
78 | "src": "./static/img/16.jpg",
79 | "href": "https://www.baidu.com",
80 | "info": "一些图片描述文字"
81 | },
82 | {
83 | "src": "./static/img/17.jpg",
84 | "href": "https://www.baidu.com",
85 | "info": "一些图片描述文字"
86 | },
87 | {
88 | "src": "./static/img/18.jpg",
89 | "href": "https://www.baidu.com",
90 | "info": "一些图片描述文字"
91 | },
92 | {
93 | "src": "./static/img/19.jpg",
94 | "href": "https://www.baidu.com",
95 | "info": "一些图片描述文字"
96 | },
97 | {
98 | "src": "./static/img/20.jpg",
99 | "href": "https://www.baidu.com",
100 | "info": "一些图片描述文字"
101 | }
102 | ]
103 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 | #app
3 | a#header(href="https://github.com/lfyfly/vue-waterfall-easy",target="_blank",title="github of vue-waterfall-easy") vue-waterfall-easy
4 | button(:style="{position:'fixed',zIndex:10000}", @click="changeImgArr") changeImgArr
5 | a.typetype(href="https://dazidazi.com", target="_blank")
6 | button(:style="{position:'fixed',zIndex:10000, left: '120px'}") 程序员提高打字速度
7 |
8 | #content
9 | //- vue-waterfall-easy(ref="waterfall",:imgsArr="imgsArr",@scrollReachBottom="getData", @click="clickFn", :enablePullDownEvent="true", @pullDownMove="pullDownMove",@pullDownEnd="pullDownEnd")
10 | vue-waterfall-easy(ref="waterfall",:imgsArr="imgsArr",@scrollReachBottom="getData", @click="clickFn", @imgError="imgErrorFn")
11 | .img-info(slot-scope="props")
12 | p.some-info 第{{props.index+1}}张图片
13 | p.some-info {{props.value.info}}
14 |
15 | //-div(slot="waterfall-head")
16 | h1 waterfall-head
17 | h1 waterfall-head
18 |
19 | //- 自定义加载动画
20 | //-div(slot="loading" slot-scope="{isFirstLoad}")
21 | div(slot="loading" v-if="isFirstLoad") first-loading...
22 | div(v-else) loading...
23 |
24 |
25 |
89 |
90 |
148 |
--------------------------------------------------------------------------------
/demo/static/js/manifest.3ad1d5771e9b13dbdad2.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/bootstrap 8d61b52d4f1af21a7301"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8d61b52d4f1af21a7301"],"sourceRoot":""}
--------------------------------------------------------------------------------
/demo/static/css/app.befdc0535133fb008f520586dae6d62d.css:
--------------------------------------------------------------------------------
1 | *{margin:0;padding:0}a{text-decoration:none}a,a:active{color:#000}#app,body,html{height:100%}.typetype button{cursor:pointer;font-size:18px;padding:0 10px}#app #header{display:block;text-align:center;background:#000;color:#ccc;line-height:32px;font-size:16px;font-weight:700;letter-spacing:2px;position:fixed;z-index:999;width:100%}#app #content{position:absolute;top:32px;bottom:0;width:100%}#app{overflow:auto;position:relative}#app .some-info{line-height:1.6;text-align:center}.vue-waterfall-easy-container[data-v-50f05506]{width:100%;height:100%;position:relative}.vue-waterfall-easy-container .vue-waterfall-easy-scroll[data-v-50f05506]{position:relative;width:100%;height:100%;overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch}.vue-waterfall-easy-container .vue-waterfall-easy[data-v-50f05506]{position:absolute;width:100%}@keyframes show-card-data-v-50f05506{0%{transform:scale(.5)}to{transform:scale(1)}}.vue-waterfall-easy-container .vue-waterfall-easy>.img-box[data-v-50f05506]{position:absolute;box-sizing:border-box;width:50%}.vue-waterfall-easy-container .vue-waterfall-easy>.img-box.default-card-animation[data-v-50f05506]{animation:show-card-data-v-50f05506 .4s;transition:left .6s,top .6s;transition-delay:.1s}.vue-waterfall-easy-container .vue-waterfall-easy a[data-v-50f05506]{display:block}.vue-waterfall-easy-container .vue-waterfall-easy a.img-inner-box[data-v-50f05506]{box-shadow:0 1px 3px rgba(0,0,0,.3);border-radius:4px}.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper[data-v-50f05506]{background-image:url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAeAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI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SV1XqdL1VGc8lxk47bAUxyqqO60GIpuL5LyuxZNNVVtmAmVfkpbbi1RYAI1QVRYAI1QJ1aRYzdAbJ8Y1I1RZggI1SNxL8uW1NCoAYxckqKiu9Bm0lV23ZFtyfJ+F2Ayyr0K4VSNf8ArUnFcpKO250LRUQABoAYLkhzXdWHMA5u26uNGXF9tx8uOusfYlbTcC6aaqrdTTnTlHVfQrHJF6PRsBwAAC5i9vg0xbgaAIAAxtJVduosskVotWiTcpav6ANKXJ9the27sF9NyuLHTWXsA2OHBd3cYDQAAAAAAAwSeNS1syhgHNRxdJfUK10ujoaTuJLCrp0Amm1Ztdhv6z3Sfkxwmu4leqoBT+1P1f8AkZy4469daEaopllRqPRAH9ZOyp5Fbbu2+xmuyGUJvsAtaaWQUcnSP1Kxwq7dR0krALDGo63Y4GgAAAAAAAAAAAAAAAAAshJ7AAGK6B3YABsNx4gADAAAAAAAAAAAAAf/2Q==);background-repeat:no-repeat;background-position:50%;background-size:50% 50%}.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper img[data-v-50f05506]{display:none}.vue-waterfall-easy-container .vue-waterfall-easy a.img-wraper>img[data-v-50f05506]{width:100%;display:block;border:none}.vue-waterfall-easy-container .vue-waterfall-easy .over[data-v-50f05506]{position:absolute;width:100%;text-align:center;font-size:12px;line-height:1.6;color:#aaa}.vue-waterfall-easy-container>.loading.first[data-v-50f05506]{bottom:50%;transform:translate(-50%,50%)}.vue-waterfall-easy-container>.loading[data-v-50f05506]{position:absolute;left:50%;transform:translateX(-50%);bottom:6px;z-index:999}@keyframes ball-beat-data-v-50f05506{50%{opacity:.2;transform:scale(.75)}to{opacity:1;transform:scale(1)}}.vue-waterfall-easy-container>.loading.ball-beat>.dot[data-v-50f05506]{vertical-align:bottom;background-color:#4b15ab;width:12px;height:12px;border-radius:50%;margin:3px;animation-fill-mode:both;display:inline-block;animation:ball-beat-data-v-50f05506 .7s 0s infinite linear}.vue-waterfall-easy-container>.loading.ball-beat>.dot[data-v-50f05506]:nth-child(2n-1){animation-delay:.35s}
2 | /*# sourceMappingURL=app.befdc0535133fb008f520586dae6d62d.css.map */
--------------------------------------------------------------------------------
/README-CN.md:
--------------------------------------------------------------------------------
1 | # vue-waterfall-easy 2.x
2 | 1. 这是一个vue组件,包含瀑布流布局和无限滚动加载
3 | 2. 相比其他实现方式,无需在返回的数据中指定图片的宽度和高度
4 | 3. 正是因为第2条,所以采用的是图片预加载之后,再排版
5 | 4. 响应式,兼容移动端
6 | 5. 支持无图模式(@2.4.0)
7 | 6. 使用及其简单
8 |
9 | ## [在线DEMO](https://lfyfly.github.io/vue-waterfall-easy/demo/)
10 | ## [Demo案例代码](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
11 | ## [更新列表](https://github.com/lfyfly/vue-waterfall-easy/issues/8)
12 | ## [github](https://github.com/lfyfly/vue-waterfall-easy)
13 |
14 | ## 1. 使用
15 | ### 1.1 npm安装
16 |
17 | ```
18 | npm install vue-waterfall-easy --save-dev
19 | ```
20 | ### 1.2 es6语法引用
21 | ```js
22 | import vueWaterfallEasy from 'vue-waterfall-easy'
23 | ```
24 | ```js
25 |
26 | export default {
27 | name: 'app',
28 | components: {
29 | vueWaterfallEasy
30 | }
31 | }
32 | ```
33 | ### 1.3 js引用
34 | [下载vueWaterfallEasy.js](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/vue-waterfall-easy/script/vueWaterfallEasy.js)
35 | ```html
36 |
37 |
38 | ```
39 | ```js
40 | new Vue({
41 | el: '#app',
42 | components: {
43 | vueWaterfallEasy
44 | }
45 | })
46 | ```
47 | ### 1.4 支持 require.js sea.js 模块引用
48 |
49 | ## 2. 基本示例
50 | html
51 | ```html
52 |
53 | ```
54 |
55 | **如果imgArr是替换更新,getData新请求返回的数据覆盖原来的数据。**
56 |
57 | **如果imgArr是增量更新,getData新请求返回的数据与原来的数据进行合并,此时不建议使用替换更新,会浪费性能。下面这个例子就是增量更新。**
58 |
59 | js
60 | ```js
61 | import vueWaterfallEasy from './vue-waterfall-easy/vue-waterfall-easy.vue'
62 | import axios from 'axios'
63 |
64 | export default {
65 | name: 'app',
66 | data() {
67 | return {
68 | imgsArr: [],
69 | group: 0, // request param
70 | }
71 | },
72 | components: {
73 | vueWaterfallEasy
74 | },
75 | methods: {
76 | getData() {
77 | axios.get('./static/mock/data.json?group=' + this.group) // 真实环境中,后端会根据参数group返回新的图片数组,这里我用一个惊呆json文件模拟
78 | .then(res => {
79 | this.imgsArr = this.imgsArr.concat(res.data)
80 | this.group++
81 | })
82 | },
83 | },
84 | created() {
85 | this.getData()
86 | }
87 | }
88 | ```
89 | [详情见仓库App.vue文件](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
90 |
91 | ## 3. 组件参数
92 |
93 | 参数 | 类型 | 默认值 | 描述
94 | ---|---|---|---
95 | width | Number | - | 容器宽度(px),默认是相对父元素宽度100%,**由于响应式,此时其所有上级元素宽度必须都是相对浏览器窗口100%**,具体看该表格下面实例。 **如果为定宽的话,必须设置width值**,而不能只是其父元素设置定宽
96 | height | Number\|String | - | 容器高度,值为Number类型时默认单位px,值为String类型时可指定单位 **当不传递height值时,默认是相对父元素高度100%,此时父元素必须具有高度**
97 | gap | Number | 20 | 单位:px pc端图片之间的间距
98 | mobileGap | Number | 8 | 单位:px 移动端图片之间的间距
99 | imgsArr | Array | [] | **必填** 用于渲染瀑布流的数据 每个数组元素是个对象,应该要有src和href属性 src属性代表图片的src属性 href属性代表点击跳转的链接 **如果你的键值不是`src`和`href`,你可以使用`srcKey`和`hrefKey`这两个属性进行键值装换**
100 | srcKey | String | 'src' | 当你的图片地址键值不为`src`,可以使用该属性进行转换
101 | hrefKey | String | 'href' | 当你的图片地址键值不为`href`,可以使用该属性进行转换
102 | imgWidth | Number | 240 | 单位:px 图片的宽度
103 | maxCols | Number | 5 | 瀑布流显示最大的列数
104 | linkRange | String | 'card' | 标识点击触发跳转链接范围,值有: 'card' 整张卡牌范围跳转链接 'img' 卡片内图片范围 custom 自定义可以通过slot插槽自定义跳转链接元素
105 | isRouterLink | Boolean | false | 值为false时渲染a标签,值为true时渲染router-link组件
106 | reachBottomDistance | Number | 0 | 单位:px 滚动触发scrollReachBottom事件时的距离容器底部的距离
107 | loadingDotCount | Number | 3 | 默认loading动画点的数量
108 | loadingDotStyle | Object | null | 默认loading动画内小圆点的样式对象,可以自定义其样式
109 | loadingTimeOut | Number | 500 | 单位:ms 预加载事件小于500毫秒就不显示加载动画,增加用户体验
110 | cardAnimationClass | String | 'default-card-animation' | 用于给图片设置出现时的动画的calssName,如要去掉默认动画可以这样设置`cardAnimationClass=""`
111 | enablePullDownEvent | Boolean | false | 开启下拉事件
112 | ### waterfall组件祖先元素css样式
113 | [详情见 App.vue 文件](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
114 | ```
115 | html,
116 | body,
117 | #app {
118 | height: 100%; // 父元素必须要有高度
119 | width: 100%; // 如果已经是block元素,则可以忽略
120 | }
121 | ```
122 |
123 |
124 | ## 4. 事件
125 | 事件名 | 描述
126 | ---|---
127 | scrollReachBottom | 滚动条滚动到底部时,用于请求新的图片数据
128 | preloaded | 每次图片预加载完成执行
129 | click | 当卡片被点击时触发,看下面的实例
130 | imgError | 图片加载错误事件,第一个参数可获取到当前加载错误图片的相关数据
131 | pullDownMove | 移动端生效,触摸下拉事件,第一个参数可获取Y轴移动距离差,常用于下拉刷新
132 | pullDownEnd | 移动端生效,触摸下拉事件手指抬起,常用于下拉刷新
133 |
134 | click事件使用实例
135 | ```html
136 |
137 | ```
138 | ```js
139 | clickFn(event, { index, value }) {
140 | // 阻止a标签跳转
141 | event.preventDefault()
142 | // 只有当点击到图片时才进行操作
143 | if (event.target.tagName.toLowerCase() == 'img') {
144 | console.log('img clicked',index, value)
145 | }
146 | }
147 | ```
148 | ## 5. 组件方法
149 | ### 5.1 waterfallOver
150 | 当滚动加载数据结束时,手动调用,将会取消滚动加载
151 | ```
152 | this.$refs.waterfall.waterfallOver()
153 | ```
154 | [详情见仓库App.vue文件](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
155 | ## 6. slot插槽
156 | ### 6.1 默认slot
157 | 进行自定义图片的描述信息
158 | #### 参数说明
159 | 参数 | 描述
160 | ---|---
161 | props.index | 图片在数组中的索引,从0开始
162 | props.value | 遍历参数imgsArr的元素值
163 |
164 | ```html
165 |
166 |
167 |
第{{props.index+1}}张图片
168 |
{{props.value.info}}
169 |
170 |
171 | ```
172 | ### 6.2 slot="loading"
173 | 自定义加载动画
174 | ```html
175 |
176 |
first-loading...
177 |
loading...
178 |
179 | ```
180 | ### 6.3 slot="waterfall-head"
181 | 容器头部内容插槽
182 | ```html
183 |
184 | waterfall-head
185 |
186 | ```
187 |
188 | ### 6.4 slot="waterfall-over"
189 | 调用`waterfallOver`方法后才会显示,用于瀑布流结束提醒,默认值是`被你看光了`
190 | ```html
191 |
192 | waterfall-over
193 |
194 | ```
195 |
196 | ## 7. 兼容移动端
197 | 别忘记在index.html head中添加一下代码
198 | ```html
199 |
200 | ```
201 |
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-waterfall-easy 2.x
2 | 1. This is a vue component that contains waterfall flow layout and infinite scroll loading
3 | 2. Compared to other implementations,there is no need to specify the width and height of the image in the returned data
4 | 3. It is because of the second item that the image is preloaded and then layout
5 | 4. Responsive layout,adapt mobile
6 | 5. Simple to use
7 |
8 | ## [中文文档](https://github.com/lfyfly/vue-waterfall-easy/blob/master/README-CN.md)
9 | ## [Demo](https://lfyfly.github.io/vue-waterfall-easy/demo/)
10 | ## [code of demo](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
11 | ## [update list](https://github.com/lfyfly/vue-waterfall-easy/issues/8)
12 | ## [github](https://github.com/lfyfly/vue-waterfall-easy)
13 |
14 | ## 1. Usage
15 | ### 1.1 Installation
16 |
17 | ```
18 | npm install vue-waterfall-easy --save
19 | ```
20 |
21 | ### 1.2 es6 import
22 | ```js
23 | import vueWaterfallEasy from 'vue-waterfall-easy'
24 | ```
25 | ```js
26 |
27 | export default {
28 | name: 'app',
29 | components: {
30 | vueWaterfallEasy
31 | }
32 | }
33 | ```
34 | ### 1.3 scripts import
35 | [download vueWaterfallEasy.js](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/vue-waterfall-easy/script/vueWaterfallEasy.js)
36 | ```html
37 |
38 |
39 | ```
40 | ```js
41 | new Vue({
42 | el: '#app',
43 | components: {
44 | vueWaterfallEasy
45 | }
46 | })
47 | ```
48 | ### 1.4 Supports require.js and sea.js module import
49 |
50 | ## 2. Basic example
51 | html
52 | ```html
53 |
54 | ```
55 |
56 | **If imgArr is a replacement update, the data returned by the getData method new request overwrites the original data.**
57 |
58 | **If imgArr is an incremental update, the data returned by the new request of getData method is merged with the original data. At this time, it is not recommended to use the replacement update, which will waste performance. The following example is an incremental update.**
59 |
60 | js
61 |
62 | ```js
63 | import vueWaterfallEasy from './vue-waterfall-easy/vue-waterfall-easy.vue'
64 | import axios from 'axios'
65 | export default {
66 | name: 'app',
67 | data() {
68 | return {
69 | imgsArr: [],
70 | group: 0,// request param
71 | }
72 | },
73 | components: {
74 | vueWaterfallEasy
75 | },
76 | methods: {
77 | getData() {
78 | // In the real environment,the backend will return a new image array based on the parameter group.
79 | // Here I simulate it with a stunned json file.
80 | axios.get('./static/mock/data.json?group=' + this.group)
81 | .then(res => {
82 | this.imgsArr = this.imgsArr.concat(res.data)
83 | this.group++
84 | })
85 | },
86 | },
87 | created() {
88 | this.getData()
89 | }
90 | }
91 | ```
92 | [more detail see App.vue file](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
93 |
94 | ## 3. Props
95 | props | type | default | description
96 | ---|---|---|---
97 | width | Number | - | Container width(px),default is 100% relative parent element width,**Due to the responsiveness,all its parent's width must be 100% relative to the browser window at this time**,See the example after the table **If it is fixed width, you must set the width prop **, not just its parent element set fixed width
98 | height | Number\|String | - | Container height, the default unit `px` for the value of the `Number` type, the unit can be specified when the value is the type of `String` **When you do not specify the `height` value, the default is relative to the height of the parent element 100%, then the parent element must have a height**
99 | gap | Number | 20 | [Pc] space between pictures(px)
100 | mobileGap | Number | 8 | [Mobile] space between pictures(px)
101 | imgsArr | Array | [] | **required** Data used to render the waterfall stream Each array element is an object and must have `src` and `href` attributes. The `src` attribute represents the SRC attribute of the picture The `href` attribute represents the link to click to jump **if your key is not `src` and `href`, you can use the two properties of `srcKey` and `hrefKey` to do the key value replacement.**
102 | srcKey | String | 'src' | When the key value of your picture address is not `src`, you can use this property to replace it.
103 | hrefKey | String | 'href' | When the key value of your picture address is not `href`, you can use this property to replace it.
104 | imgWidth | Number | 240 | The width of the picture(px)
105 | maxCols | Number | 5 | Waterfall shows the maximum number of columns
106 | linkRange | String | 'card' | Identify click to trigger jump link range value: 'card' Whole card range 'img' image range 'custom' Customize the link range through slots
107 | isRouterLink | Boolean | false | Render the a tag when the value is false Render the router-link component when the value is true
108 | reachBottomDistance | Number | 0 | The distance(px) from the bottom of the container when the scrolling triggers the scrollReachBottom event
109 | loadingDotCount | Number | 3 | The number of default loading animation dots
110 | loadingDotStyle | Object | null | The style object of the small dots in the default loading element
111 | loadingTimeOut | Number | 500 | Preloading events less than 500ms milliseconds do not display loading animations,increasing the user experience
112 | cardAnimationClass | String | 'default-card-animation' | the animation className for the card
113 | enablePullDownEvent | Boolean | false | enable the drop-down event
114 |
115 | ## 4. Event
116 | event name | description
117 | ---|---
118 | scrollReachBottom | When the scroll bar scrolls to the bottom,it is used to trigger a request for new image data
119 | preloaded | Trigger every time image preloading is completed
120 | click | Trigger when the card is clicked,look at an example under the table
121 | imgError | Trigger when img load error
122 | pullDownMove | The mobile terminal takes effect, touches the pull-down event, and the first parameter can obtain the Y-axis moving distance difference, which is often used for pull-down refresh.
123 | pullDownEnd | The mobile terminal takes effect, and the touch pull-down event is raised by the finger, which is often used for pull-down refresh.
124 | click event demo
125 | ```html
126 |
127 | ```
128 | ```js
129 | clickFn(event, { index, value }) {
130 | // Prevent a tag jump
131 | event.preventDefault()
132 | // Do it only when you click on the image
133 | if (event.target.tagName.toLowerCase() == 'img') {
134 | console.log('img clicked',index, value)
135 | }
136 | }
137 | ```
138 | ## 5. methods
139 | ### 5.1 waterfallOver
140 | When the rolling load data is over, manual invoking will remove the scroll event.
141 | ```
142 | this.$refs.waterfall.waterfallOver()
143 | ```
144 | [more detail see App.vue](https://github.com/lfyfly/vue-waterfall-easy/blob/master/src/App.vue)
145 | ## 6. slot
146 | ### 6.1 default slot
147 | Custom picture description element
148 | #### parameter
149 | parameterpar | description
150 | ---|---
151 | props.index | The index of the image in the data array,starting from 0
152 | props.value | The value of imgsArr item
153 |
154 | ```html
155 |
156 |
157 |
picture index: {{props.index}}
158 |
{{props.value.info}}
159 |
160 |
161 | ```
162 | ### 6.2 slot="loading"
163 | Custom loading element
164 | ```html
165 |
166 |
first-loading...
167 |
loading...
168 |
169 | ```
170 | ### 6.3 slot="waterfall-head"
171 | Waterfall container head slot
172 | ```html
173 |
174 | waterfall-head
175 |
176 | ```
177 | ### 6.4 slot="waterfall-over"
178 | when `waterfallOver` method is called,this slot will show
179 | ```html
180 |
181 | waterfall-over
182 |
183 | ```
184 |
185 |
186 | ## 7. Adapted mobile
187 | Don't forget to add following code in index.html \
188 | ```html
189 |
190 | ```
191 |
192 |
193 |
--------------------------------------------------------------------------------
/demo/static/css/app.befdc0535133fb008f520586dae6d62d.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["app.befdc0535133fb008f520586dae6d62d.css"],"names":[],"mappings":"AACA,EACE,SAAU,AACV,SAAW,CACZ,AACD,EAEE,oBAAsB,CACvB,AACD,WAHE,UAAY,CAKb,AACD,eAGE,WAAa,CACd,AACD,iBACE,eAAgB,AAChB,eAAgB,AAChB,cAAgB,CACjB,AAID,aACI,cAAe,AACf,kBAAmB,AACnB,gBAAiB,AACjB,WAAe,AACf,iBAAkB,AAClB,eAAgB,AAChB,gBAAkB,AAClB,mBAAoB,AACpB,eAAgB,AAChB,YAAa,AACb,UAAY,CACf,AACD,cACI,kBAAmB,AACnB,SAAU,AACV,SAAU,AACV,UAAY,CACf,AACD,KACE,cAAe,AACf,iBAAmB,CACpB,AACD,gBACI,gBAAiB,AACjB,iBAAmB,CACtB,AAED,+CACE,WAAY,AACZ,YAAa,AACb,iBAAmB,CACpB,AACD,0EACI,kBAAmB,AACnB,WAAY,AACZ,YAAa,AACb,kBAAmB,AACnB,kBAAmB,AACnB,gCAAkC,CACrC,AACD,mEACI,kBAAmB,AACnB,UAAY,CACf,AAWD,qCACA,GAEY,mBAAsB,CACjC,AACD,GAEY,kBAAoB,CAC/B,CACA,AACD,4EACM,kBAAmB,AAEX,sBAAuB,AAC/B,SAAW,CAChB,AACD,mGAEc,wCAA0C,AAElD,4BAAgC,AAExB,oBAAuB,CACpC,AACD,qEACM,aAAe,CACpB,AACD,mFAEc,oCAAyC,AACjD,iBAAmB,CACxB,AACD,wFACM,s7FAAu7F,AACv7F,4BAA6B,AAC7B,wBAA4B,AAC5B,uBAAyB,CAC9B,AACD,4FACQ,YAAc,CACrB,AACD,oFACM,WAAY,AACZ,cAAe,AACf,WAAa,CAClB,AACD,yEACM,kBAAmB,AACnB,WAAY,AACZ,kBAAmB,AACnB,eAAgB,AAChB,gBAAiB,AACjB,UAAY,CACjB,AACD,8DACI,WAAY,AAEJ,6BAAgC,CAC3C,AACD,wDACI,kBAAmB,AACnB,SAAU,AAEF,2BAA4B,AACpC,WAAY,AACZ,WAAa,CAChB,AAaD,qCACA,IACI,WAAa,AAEL,oBAAuB,CAClC,AACD,GACI,UAAW,AAEH,kBAAoB,CAC/B,CACA,AACD,uEACM,sBAAuB,AACvB,yBAA0B,AAC1B,WAAY,AACZ,YAAa,AACb,kBAAmB,AACnB,WAAY,AAEJ,yBAA0B,AAClC,qBAAsB,AAEd,0DAA6D,CAC1E,AACD,uFAEc,oBAAuB,CACpC","file":"app.befdc0535133fb008f520586dae6d62d.css","sourcesContent":["\n* {\n margin: 0;\n padding: 0;\n}\na {\n color: #000;\n text-decoration: none;\n}\na:active {\n color: #000;\n}\nhtml,\nbody,\n#app {\n height: 100%;\n}\n.typetype button {\n cursor: pointer;\n font-size: 18px;\n padding: 0 10px;\n}\n#app {\n position: relative;\n}\n#app #header {\n display: block;\n text-align: center;\n background: #000;\n color: #cccccc;\n line-height: 32px;\n font-size: 16px;\n font-weight: bold;\n letter-spacing: 2px;\n position: fixed;\n z-index: 999;\n width: 100%;\n}\n#app #content {\n position: absolute;\n top: 32px;\n bottom: 0;\n width: 100%;\n}\n#app {\n overflow: auto;\n position: relative;\n}\n#app .some-info {\n line-height: 1.6;\n text-align: center;\n}\n\n.vue-waterfall-easy-container[data-v-50f05506] {\n width: 100%;\n height: 100%;\n position: relative;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy-scroll[data-v-50f05506] {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy[data-v-50f05506] {\n position: absolute;\n width: 100%;\n}\n@-webkit-keyframes show-card-data-v-50f05506 {\n0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n}\n100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@keyframes show-card-data-v-50f05506 {\n0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n}\n100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n.vue-waterfall-easy-container .vue-waterfall-easy > .img-box[data-v-50f05506] {\n position: absolute;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 50%;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy > .img-box.default-card-animation[data-v-50f05506] {\n -webkit-animation: show-card-data-v-50f05506 0.4s;\n animation: show-card-data-v-50f05506 0.4s;\n -webkit-transition: left 0.6s, top 0.6s;\n transition: left 0.6s, top 0.6s;\n -webkit-transition-delay: 0.1s;\n transition-delay: 0.1s;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a[data-v-50f05506] {\n display: block;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a.img-inner-box[data-v-50f05506] {\n -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);\n border-radius: 4px;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper[data-v-50f05506] {\n background-image: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAeAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjk1M0JCM0QwNkVFNDExRThCNTJCQUQ2RDFGQzg0NzIxIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjk1M0JCM0NGNkVFNDExRThCNTJCQUQ2RDFGQzg0NzIx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AAAf/2Q==);\n background-repeat: no-repeat;\n background-position: center;\n background-size: 50% 50%;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper img[data-v-50f05506] {\n display: none;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a.img-wraper > img[data-v-50f05506] {\n width: 100%;\n display: block;\n border: none;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .over[data-v-50f05506] {\n position: absolute;\n width: 100%;\n text-align: center;\n font-size: 12px;\n line-height: 1.6;\n color: #aaa;\n}\n.vue-waterfall-easy-container > .loading.first[data-v-50f05506] {\n bottom: 50%;\n -webkit-transform: translate(-50%, 50%);\n transform: translate(-50%, 50%);\n}\n.vue-waterfall-easy-container > .loading[data-v-50f05506] {\n position: absolute;\n left: 50%;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n bottom: 6px;\n z-index: 999;\n}\n@-webkit-keyframes ball-beat-data-v-50f05506 {\n50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@keyframes ball-beat-data-v-50f05506 {\n50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n.vue-waterfall-easy-container > .loading.ball-beat > .dot[data-v-50f05506] {\n vertical-align: bottom;\n background-color: #4b15ab;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n margin: 3px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation: ball-beat-data-v-50f05506 0.7s 0s infinite linear;\n animation: ball-beat-data-v-50f05506 0.7s 0s infinite linear;\n}\n.vue-waterfall-easy-container > .loading.ball-beat > .dot[data-v-50f05506]:nth-child(2n-1) {\n -webkit-animation-delay: 0.35s;\n animation-delay: 0.35s;\n}\n"]}
--------------------------------------------------------------------------------
/demo/static/js/app.ff2dec037ff7f4c9baa9.js:
--------------------------------------------------------------------------------
1 | webpackJsonp([1],{"2EM+":function(t,e){},NHnr:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("7+uW"),r={render:function(){var t=this.$createElement;return(this._self._c||t)("a",{staticClass:"alink",attrs:{href:this.to,target:"_blank"}},[this._t("default")],2)},staticRenderFns:[]};var n={name:"vue-waterfall-easy",components:{alink:i("VU/8")({name:"alink",props:["to"],data:function(){return{msg:"this is from alink.vue"}},methods:{}},r,!1,function(t){i("2EM+")},null,null).exports},props:{width:{type:Number},height:{type:[Number,String]},reachBottomDistance:{type:Number,default:20},loadingDotCount:{type:Number,default:3},loadingDotStyle:{type:Object},gap:{type:Number,default:20},mobileGap:{type:Number,default:8},maxCols:{type:Number,default:5},imgsArr:{type:Array,required:!0},srcKey:{type:String,default:"src"},hrefKey:{type:String,default:"href"},imgWidth:{type:Number,default:240},isRouterLink:{type:Boolean,default:!1},linkRange:{type:String,default:"card"},loadingTimeOut:{type:Number,default:500},cardAnimationClass:{type:[String],default:"default-card-animation"},enablePullDownEvent:{type:Boolean,default:!1}},data:function(){return{msg:"this is from vue-waterfall-easy.vue",isMobile:!!navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i),isPreloading:!0,isPreloading_c:!0,imgsArr_c:[],loadedCount:0,cols:NaN,imgBoxEls:null,beginIndex:0,colsHeightArr:[],LoadingTimer:null,isFirstLoad:!0,over:!1}},computed:{colWidth:function(){return this.imgWidth+this.gap},imgWidth_c:function(){return this.isMobile?window.innerWidth/2-this.mobileGap:this.imgWidth},hasLoadingSlot:function(){return!!this.$scopedSlots.loading}},mounted:function(){var t=this;this.bindClickEvent(),this.loadingMiddle(),this.preload(),this.cols=this.calcuCols(),this.$on("preloaded",function(){t.isFirstLoad=!1,t.imgsArr_c=t.imgsArr.concat([]),t.$nextTick(function(){t.isPreloading=!1,t.imgBoxEls=t.$el.getElementsByClassName("img-box"),t.waterfall()})}),this.isMobile||this.width||window.addEventListener("resize",this.response),this.isMobile&&this.enablePullDownEvent&&this.pullDown(),this.scroll()},beforeDestroy:function(){window.removeEventListener("resize",this.response)},watch:{isPreloading:function(t,e){var i=this;t?setTimeout(function(){i.isPreloading&&(i.isPreloading_c=!0)},this.loadingTimeOut):this.isPreloading_c=!1},imgsArr:function(t,e){(this.imgsArr_c.length>t.length||this.imgsArr_c.length>0&&t[0]&&!t[0]._height)&&this.reset(),this.preload()}},methods:{preload:function(t,e){var i=this;this.imgsArr.forEach(function(t,e){if(!(ethis.maxCols?this.maxCols:e},waterfall:function(){if(this.imgBoxEls){var t,e,i,s=this.isMobile?this.imgBoxEls[0].offsetWidth:this.colWidth;0==this.beginIndex&&(this.colsHeightArr=[]);for(var r=this.beginIndex;re-this.reachBottomDistance&&(this.isPreloading=!0,this.$emit("scrollReachBottom"))}},scroll:function(){this.$refs.scrollEl.addEventListener("scroll",this.scrollFn)},waterfallOver:function(){this.$refs.scrollEl.removeEventListener("scroll",this.scrollFn),this.isPreloading=!1,this.over=!0,this.setOverTipPos()},setOverTipPos:function(){var t=this,e=Math.max.apply(null,this.colsHeightArr);this.$nextTick(function(){t.$refs.over.style.top=e+"px"})},bindClickEvent:function(){var t=this;this.$el.querySelector(".vue-waterfall-easy").addEventListener("click",function(e){var i=e.target;if(-1===e.target.className.indexOf("over")&&-1==i.className.indexOf("img-box")){for(;-1==i.className.indexOf("img-inner-box");)i=i.parentNode;var s=i.getAttribute("data-index");t.$emit("click",e,{index:s,value:t.imgsArr_c[s]})}})},pullDown:function(){var t,e=this,i=this.$el.querySelector(".vue-waterfall-easy-scroll");i.addEventListener("touchmove",function(s){if(0===i.scrollTop){var r=s.changedTouches[0];t||(t=r.pageY);var n=r.pageY-t;n>0&&s.preventDefault(),e.$emit("pullDownMove",n)}}),i.addEventListener("touchend",function(s){0===i.scrollTop&&(t=NaN,e.$emit("pullDownEnd"))})},loadingMiddle:function(){var t=this.$el.querySelector(".vue-waterfall-easy-scroll"),e=t.offsetWidth-t.clientWidth;this.$el.querySelector(".loading").style.marginLeft=-e/2+"px"},reset:function(){this.imgsArr_c=[],this.beginIndex=0,this.loadedCount=0,this.isFirstLoad=!0,this.isPreloading=!0,this.scroll(),this.over=!1}}},a={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"vue-waterfall-easy-container",style:{width:t.width&&!t.isMobile?t.width+"px":"",height:parseFloat(t.height)==t.height?t.height+"px":t.height}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.isPreloading_c,expression:"isPreloading_c"}],staticClass:"loading ball-beat",class:{first:t.isFirstLoad}},[t._t("loading",null,{isFirstLoad:t.isFirstLoad}),t._l(t.loadingDotCount,function(e){return t.hasLoadingSlot?t._e():i("div",{staticClass:"dot",style:t.loadingDotStyle})})],2),i("div",{ref:"scrollEl",staticClass:"vue-waterfall-easy-scroll"},[t._t("waterfall-head"),i("div",{staticClass:"vue-waterfall-easy",style:t.isMobile?"":{width:t.colWidth*t.cols+"px",left:"50%",marginLeft:-1*t.colWidth*t.cols/2+"px"}},[t._l(t.imgsArr_c,function(e,s){return i("div",{staticClass:"img-box",class:[t.cardAnimationClass,{__err__:e._error}],style:{padding:(t.isMobile?t.mobileGap:t.gap)/2+"px",width:t.isMobile?"":t.colWidth+"px"}},[i(t.isRouterLink&&"card"==t.linkRange?"router-link":"alink",{tag:"component",staticClass:"img-inner-box",attrs:{"data-index":s,to:"card"==t.linkRange&&e[t.hrefKey]}},[e[t.srcKey]?i(t.isRouterLink&&"img"==t.linkRange?"router-link":"alink",{tag:"component",staticClass:"img-wraper",style:{width:t.imgWidth_c+"px",height:!!e._height&&e._height+"px"},attrs:{to:"img"==t.linkRange&&e[t.hrefKey]}},[i("img",{attrs:{src:e[t.srcKey]}})]):t._e(),t._t("default",null,{index:s,value:e})],2)],1)}),t.over?i("div",{ref:"over",staticClass:"over"},[t._t("waterfall-over",[t._v("被你看光了")])],2):t._e()],2)],2)])},staticRenderFns:[]};var o=i("VU/8")(n,a,!1,function(t){i("NM6C")},"data-v-50f05506",null).exports,l=i("mtWM"),c=i.n(l),h={name:"app",data:function(){return{imgsArr:[],group:0,pullDownDistance:0}},components:{vueWaterfallEasy:o},methods:{getData:function(){var t=this;c.a.get("./static/mock/data.json?group="+this.group).then(function(e){t.group++,10!==t.group?t.imgsArr=t.imgsArr.concat(e.data):t.$refs.waterfall.waterfallOver()})},clickFn:function(t,e){var i=e.index,s=e.value;"img"==t.target.tagName.toLowerCase()&&console.log("img clicked",i,s)},imgErrorFn:function(t){console.log("图片加载错误",t)},changeImgArr:function(){var t=this;c.a.get("./static/mock/data-change.json").then(function(e){t.imgsArr=e.data})},pullDownMove:function(t){this.pullDownDistance=t},pullDownEnd:function(t){console.log("pullDownEnd"),this.pullDownDistance>50&&alert("下拉刷新"),this.pullDownDistance=0}},created:function(){this.getData()}},d={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"app"}},[i("a",{attrs:{id:"header",href:"https://github.com/lfyfly/vue-waterfall-easy",target:"_blank",title:"github of vue-waterfall-easy"}},[t._v("vue-waterfall-easy")]),i("button",{style:{position:"fixed",zIndex:1e4},on:{click:t.changeImgArr}},[t._v("changeImgArr")]),i("a",{staticClass:"typetype",attrs:{href:"https://dazidazi.com",target:"_blank"}},[i("button",{style:{position:"fixed",zIndex:1e4,left:"120px"}},[t._v("程序员提高打字速度")])]),i("div",{attrs:{id:"content"}},[i("vue-waterfall-easy",{ref:"waterfall",attrs:{imgsArr:t.imgsArr},on:{scrollReachBottom:t.getData,click:t.clickFn,imgError:t.imgErrorFn},scopedSlots:t._u([{key:"default",fn:function(e){return i("div",{staticClass:"img-info"},[i("p",{staticClass:"some-info"},[t._v("第"+t._s(e.index+1)+"张图片")]),i("p",{staticClass:"some-info"},[t._v(t._s(e.value.info))])])}}])})],1)])},staticRenderFns:[]};var u=i("VU/8")(h,d,!1,function(t){i("eqeN")},null,null).exports,g=i("/ocq");s.a.use(g.a);var f=new g.a({routes:[{path:"/test",name:"test",component:{name:"test",template:"test test test test test test "}}]}),m=i("Gs/g"),p=i.n(m);window.Promise||(window.Promise=p.a),new s.a({el:"#app",router:f,template:" ",components:{App:u}})},NM6C:function(t,e){},eqeN:function(t,e){}},["NHnr"]);
2 | //# sourceMappingURL=app.ff2dec037ff7f4c9baa9.js.map
--------------------------------------------------------------------------------
/src/vue-waterfall-easy/vue-waterfall-easy.vue:
--------------------------------------------------------------------------------
1 |
2 |
107 |
108 |
109 |
110 | .vue-waterfall-easy-container(:style="{width: width&&!isMobile ? width+'px' : '', height: parseFloat(height)==height ? height+'px': height }")
111 | .loading.ball-beat(v-show="isPreloading_c", :class="{first:isFirstLoad}")
112 | slot(name="loading", :isFirstLoad="isFirstLoad")
113 | .dot(v-if="!hasLoadingSlot", v-for="n in loadingDotCount",:style="loadingDotStyle")
114 | //- 为了防止loading 跟随滚动
115 | .vue-waterfall-easy-scroll(ref="scrollEl")
116 | slot(name="waterfall-head")
117 | .vue-waterfall-easy(:style="isMobile? '' :{width: colWidth*cols+'px',left:'50%', marginLeft: -1*colWidth*cols/2 +'px'}")
118 | .img-box(
119 | v-for="(v,i) in imgsArr_c",
120 | :class="[cardAnimationClass, {__err__: v._error}]"
121 | :style="{padding: (isMobile ? mobileGap : gap)/2+'px', width: isMobile ? '' : colWidth+'px'}"
122 | )
123 | component.img-inner-box(
124 | :is="isRouterLink && linkRange=='card' ? 'router-link' : 'alink'",
125 | :data-index="i",
126 | :to="linkRange=='card' ? v[hrefKey] : false")
127 | component.img-wraper(
128 | v-if="v[srcKey]",
129 | :is="isRouterLink && linkRange=='img' ? 'router-link' :'alink'",
130 | :to="linkRange=='img' ? v[hrefKey] : false ",
131 | :style="{width:imgWidth_c + 'px',height:v._height ? v._height+'px':false}")
132 | img(:src="v[srcKey]")
133 | slot(:index="i",:value="v")
134 | .over(v-if="over",ref="over")
135 | slot(name="waterfall-over") 被你看光了
136 |
137 |
138 |
139 |
460 |
--------------------------------------------------------------------------------
/src/vue-waterfall-easy/script/vueWaterfallEasy.js:
--------------------------------------------------------------------------------
1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&(define.amd||defined.cmd)?define([],t):"object"==typeof exports?exports.vueWaterfallEasy=t():e.vueWaterfallEasy=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t){function n(e,t){var n=e[1]||"",a=e[3];if(!a)return n;if(t&&"function"==typeof btoa){var r=i(a);return[n].concat(a.sources.map(function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"})).concat([r]).join("\n")}return[n].join("\n")}function i(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=n(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},a=0;an.parts.length&&(i.parts.length=n.parts.length)}else{for(var s=[],a=0;ae.length||this.imgsArr_c.length>0&&e[0]&&!e[0]._height)&&this.reset(),this.preload()}},methods:{preload:function(e,t){var n=this;this.imgsArr.forEach(function(e,t){if(!(tthis.maxCols?this.maxCols:t},waterfall:function(){if(this.imgBoxEls){var e,t,n,i=this.isMobile?this.imgBoxEls[0].offsetWidth:this.colWidth;0==this.beginIndex&&(this.colsHeightArr=[]);for(var a=this.beginIndex;at-this.reachBottomDistance&&(this.isPreloading=!0,this.$emit("scrollReachBottom"))}},scroll:function(){this.$refs.scrollEl.addEventListener("scroll",this.scrollFn)},waterfallOver:function(){this.$refs.scrollEl.removeEventListener("scroll",this.scrollFn),this.isPreloading=!1,this.over=!0,this.setOverTipPos()},setOverTipPos:function(){var e=this,t=Math.max.apply(null,this.colsHeightArr);this.$nextTick(function(){e.$refs.over.style.top=t+"px"})},bindClickEvent:function(){var e=this;this.$el.querySelector(".vue-waterfall-easy").addEventListener("click",function(t){var n=t.target;if(-1===t.target.className.indexOf("over")&&-1==n.className.indexOf("img-box")){for(;-1==n.className.indexOf("img-inner-box");)n=n.parentNode;var i=n.getAttribute("data-index");e.$emit("click",t,{index:i,value:e.imgsArr_c[i]})}})},pullDown:function(){var e,t=this,n=this.$el.querySelector(".vue-waterfall-easy-scroll");n.addEventListener("touchmove",function(i){if(0===n.scrollTop){var a=i.changedTouches[0];e||(e=a.pageY);var r=a.pageY-e;r>0&&i.preventDefault(),t.$emit("pullDownMove",r)}}),n.addEventListener("touchend",function(i){0===n.scrollTop&&(e=NaN,t.$emit("pullDownEnd"))})},loadingMiddle:function(){var e=this.$el.querySelector(".vue-waterfall-easy-scroll"),t=e.offsetWidth-e.clientWidth;this.$el.querySelector(".loading").style.marginLeft=-t/2+"px"},reset:function(){this.imgsArr_c=[],this.beginIndex=0,this.loadedCount=0,this.isFirstLoad=!0,this.isPreloading=!0,this.scroll(),this.over=!1}}}},function(e,t,n){"use strict";t.a={name:"alink",props:["to"],data:function(){return{msg:"this is from alink.vue"}},methods:{}}},function(e,t,n){"use strict";function i(e){s||n(6)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),r=n(13),s=!1,o=n(2),l=i,d=o(a.a,r.a,!1,l,"data-v-ded6b974",null);d.options.__file="src\\vue-waterfall-easy\\vue-waterfall-easy.vue",t.default=d.exports},function(e,t,n){var i=n(7);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n(1)("5fd04388",i,!1,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,"\n.vue-waterfall-easy-container[data-v-ded6b974] {\n width: 100%;\n height: 100%;\n position: relative;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy-scroll[data-v-ded6b974] {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy[data-v-ded6b974] {\n position: absolute;\n width: 100%;\n}\n@-webkit-keyframes show-card-data-v-ded6b974 {\n0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n}\n100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@keyframes show-card-data-v-ded6b974 {\n0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n}\n100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n.vue-waterfall-easy-container .vue-waterfall-easy > .img-box[data-v-ded6b974] {\n position: absolute;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 50%;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy > .img-box.default-card-animation[data-v-ded6b974] {\n -webkit-animation: show-card-data-v-ded6b974 0.4s;\n animation: show-card-data-v-ded6b974 0.4s;\n -webkit-transition: left 0.6s, top 0.6s;\n transition: left 0.6s, top 0.6s;\n -webkit-transition-delay: 0.1s;\n transition-delay: 0.1s;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a[data-v-ded6b974] {\n display: block;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a.img-inner-box[data-v-ded6b974] {\n -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);\n border-radius: 4px;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper[data-v-ded6b974] {\n background-image: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAeAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4w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oD08BRSXyBB/m6u2xvFPQ1qjoDAVNxqv1ZuJUnT5BGw9/AFQYAwJZf1+fsJKw+X9fn7CSsB0AAAc7VG13GxP82uoZFSbezFWkkwOgGCBgRy15adDZTaioq7QZPfwZQDFFfPc2MnB0vE1AwCc+WituPjaS4kzU6agPkS9hEVeqJJU0AAh7+ACHv4AqAAwI5X+aXQVKrS7g3WTY2ONZp7IC9AAAJ5lWNf+dSV1XqdL1VGc8lxk47bAUxyqqO60GIpuL5LyuxZNNVVtmAmVfkpbbi1RYAI1QVRYAI1QJ1aRYzdAbJ8Y1I1RZggI1SNxL8uW1NCoAYxckqKiu9Bm0lV23ZFtyfJ+F2Ayyr0K4VSNf8ArUnFcpKO250LRUQABoAYLkhzXdWHMA5u26uNGXF9tx8uOusfYlbTcC6aaqrdTTnTlHVfQrHJF6PRsBwAAC5i9vg0xbgaAIAAxtJVduosskVotWiTcpav6ANKXJ9the27sF9NyuLHTWXsA2OHBd3cYDQAAAAAAAwSeNS1syhgHNRxdJfUK10ujoaTuJLCrp0Amm1Ztdhv6z3Sfkxwmu4leqoBT+1P1f8AkZy4469daEaopllRqPRAH9ZOyp5Fbbu2+xmuyGUJvsAtaaWQUcnSP1Kxwq7dR0krALDGo63Y4GgAAAAAAAAAAAAAAAAAshJ7AAGK6B3YABsNx4gADAAAAAAAAAAAAAf/2Q==);\n background-repeat: no-repeat;\n background-position: center;\n background-size: 50% 50%;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .__err__ .img-wraper img[data-v-ded6b974] {\n display: none;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy a.img-wraper > img[data-v-ded6b974] {\n width: 100%;\n display: block;\n border: none;\n}\n.vue-waterfall-easy-container .vue-waterfall-easy .over[data-v-ded6b974] {\n position: absolute;\n width: 100%;\n text-align: center;\n font-size: 12px;\n line-height: 1.6;\n color: #aaa;\n}\n.vue-waterfall-easy-container > .loading.first[data-v-ded6b974] {\n bottom: 50%;\n -webkit-transform: translate(-50%, 50%);\n transform: translate(-50%, 50%);\n}\n.vue-waterfall-easy-container > .loading[data-v-ded6b974] {\n position: absolute;\n left: 50%;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n bottom: 6px;\n z-index: 999;\n}\n@-webkit-keyframes ball-beat-data-v-ded6b974 {\n50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@keyframes ball-beat-data-v-ded6b974 {\n50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n.vue-waterfall-easy-container > .loading.ball-beat > .dot[data-v-ded6b974] {\n vertical-align: bottom;\n background-color: #4b15ab;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n margin: 3px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation: ball-beat-data-v-ded6b974 0.7s 0s infinite linear;\n animation: ball-beat-data-v-ded6b974 0.7s 0s infinite linear;\n}\n.vue-waterfall-easy-container > .loading.ball-beat > .dot[data-v-ded6b974]:nth-child(2n-1) {\n -webkit-animation-delay: 0.35s;\n animation-delay: 0.35s;\n}\n",""])},function(e,t){e.exports=function(e,t){for(var n=[],i={},a=0;a\n\n\n\n\n.vue-waterfall-easy-container(:style=\"{width: width&&!isMobile ? width+'px' : '', height: parseFloat(height)==height ? height+'px': height }\")\n .loading.ball-beat(v-show=\"isPreloading_c\", :class=\"{first:isFirstLoad}\")\n slot(name=\"loading\", :isFirstLoad=\"isFirstLoad\")\n .dot(v-if=\"!hasLoadingSlot\", v-for=\"n in loadingDotCount\",:style=\"loadingDotStyle\")\n //- 为了防止loading 跟随滚动\n .vue-waterfall-easy-scroll(ref=\"scrollEl\")\n slot(name=\"waterfall-head\")\n .vue-waterfall-easy(:style=\"isMobile? '' :{width: colWidth*cols+'px',left:'50%', marginLeft: -1*colWidth*cols/2 +'px'}\")\n .img-box(\n v-for=\"(v,i) in imgsArr_c\",\n :class=\"[cardAnimationClass, {__err__: v._error}]\"\n :style=\"{padding: (isMobile ? mobileGap : gap)/2+'px', width: isMobile ? '' : colWidth+'px'}\"\n )\n component.img-inner-box(\n :is=\"isRouterLink && linkRange=='card' ? 'router-link' : 'alink'\",\n :data-index=\"i\",\n :to=\"linkRange=='card' ? v[hrefKey] : false\")\n component.img-wraper(\n v-if=\"v[srcKey]\",\n :is=\"isRouterLink && linkRange=='img' ? 'router-link' :'alink'\",\n :to=\"linkRange=='img' ? v[hrefKey] : false \",\n :style=\"{width:imgWidth_c + 'px',height:v._height ? v._height+'px':false}\")\n img(:src=\"v[srcKey]\")\n slot(:index=\"i\",:value=\"v\")\n .over(v-if=\"over\",ref=\"over\")\n slot(name=\"waterfall-over\") 被你看光了\n \n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/vue-waterfall-easy/vue-waterfall-easy.vue","\n\n\n\n\na.alink(:href=\"to\",target=\"_blank\")\n slot\n \n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/vue-waterfall-easy/components/alink.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"vue-waterfall-easy-container\",style:({width: _vm.width&&!_vm.isMobile ? _vm.width+'px' : '', height: parseFloat(_vm.height)==_vm.height ? _vm.height+'px': _vm.height })},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isPreloading_c),expression:\"isPreloading_c\"}],staticClass:\"loading ball-beat\",class:{first:_vm.isFirstLoad}},[_vm._t(\"loading\",null,{isFirstLoad:_vm.isFirstLoad}),_vm._l((_vm.loadingDotCount),function(n){return (!_vm.hasLoadingSlot)?_c('div',{staticClass:\"dot\",style:(_vm.loadingDotStyle)}):_vm._e()})],2),_c('div',{ref:\"scrollEl\",staticClass:\"vue-waterfall-easy-scroll\"},[_vm._t(\"waterfall-head\"),_c('div',{staticClass:\"vue-waterfall-easy\",style:(_vm.isMobile? '' :{width: _vm.colWidth*_vm.cols+'px',left:'50%', marginLeft: -1*_vm.colWidth*_vm.cols/2 +'px'})},[_vm._l((_vm.imgsArr_c),function(v,i){return _c('div',{staticClass:\"img-box\",class:[_vm.cardAnimationClass, {__err__: v._error}],style:({padding: (_vm.isMobile ? _vm.mobileGap : _vm.gap)/2+'px', width: _vm.isMobile ? '' : _vm.colWidth+'px'})},[_c(_vm.isRouterLink && _vm.linkRange=='card' ? 'router-link' : 'alink',{tag:\"component\",staticClass:\"img-inner-box\",attrs:{\"data-index\":i,\"to\":_vm.linkRange=='card' ? v[_vm.hrefKey] : false}},[(v[_vm.srcKey])?_c(_vm.isRouterLink && _vm.linkRange=='img' ? 'router-link' :'alink',{tag:\"component\",staticClass:\"img-wraper\",style:({width:_vm.imgWidth_c + 'px',height:v._height ? v._height+'px':false}),attrs:{\"to\":_vm.linkRange=='img' ? v[_vm.hrefKey] : false}},[_c('img',{attrs:{\"src\":v[_vm.srcKey]}})]):_vm._e(),_vm._t(\"default\",null,{index:i,value:v})],2)],1)}),(_vm.over)?_c('div',{ref:\"over\",staticClass:\"over\"},[_vm._t(\"waterfall-over\",[_vm._v(\"被你看光了\")])],2):_vm._e()],2)],2)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-50f05506\",\"hasScoped\":true,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/template-compiler/preprocessor.js?engine=pug!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/vue-waterfall-easy/vue-waterfall-easy.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-50f05506\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!sass-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./vue-waterfall-easy.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./vue-waterfall-easy.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./vue-waterfall-easy.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-50f05506\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/template-compiler/preprocessor?engine=pug!../../node_modules/vue-loader/lib/selector?type=template&index=0!./vue-waterfall-easy.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-50f05506\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/vue-waterfall-easy/vue-waterfall-easy.vue\n// module id = null\n// module chunks = ","\n#app\n a#header(href=\"https://github.com/lfyfly/vue-waterfall-easy\",target=\"_blank\",title=\"github of vue-waterfall-easy\") vue-waterfall-easy\n button(:style=\"{position:'fixed',zIndex:10000}\", @click=\"changeImgArr\") changeImgArr\n a.typetype(href=\"https://dazidazi.com\", target=\"_blank\")\n button(:style=\"{position:'fixed',zIndex:10000, left: '120px'}\") 程序员提高打字速度\n \n #content\n //- vue-waterfall-easy(ref=\"waterfall\",:imgsArr=\"imgsArr\",@scrollReachBottom=\"getData\", @click=\"clickFn\", :enablePullDownEvent=\"true\", @pullDownMove=\"pullDownMove\",@pullDownEnd=\"pullDownEnd\")\n vue-waterfall-easy(ref=\"waterfall\",:imgsArr=\"imgsArr\",@scrollReachBottom=\"getData\", @click=\"clickFn\", @imgError=\"imgErrorFn\")\n .img-info(slot-scope=\"props\")\n p.some-info 第{{props.index+1}}张图片\n p.some-info {{props.value.info}}\n\n //-div(slot=\"waterfall-head\")\n h1 waterfall-head\n h1 waterfall-head\n\n //- 自定义加载动画\n //-div(slot=\"loading\" slot-scope=\"{isFirstLoad}\")\n div(slot=\"loading\" v-if=\"isFirstLoad\") first-loading...\n div(v-else) loading...\n \n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('a',{attrs:{\"id\":\"header\",\"href\":\"https://github.com/lfyfly/vue-waterfall-easy\",\"target\":\"_blank\",\"title\":\"github of vue-waterfall-easy\"}},[_vm._v(\"vue-waterfall-easy\")]),_c('button',{style:({position:'fixed',zIndex:10000}),on:{\"click\":_vm.changeImgArr}},[_vm._v(\"changeImgArr\")]),_c('a',{staticClass:\"typetype\",attrs:{\"href\":\"https://dazidazi.com\",\"target\":\"_blank\"}},[_c('button',{style:({position:'fixed',zIndex:10000, left: '120px'})},[_vm._v(\"程序员提高打字速度\")])]),_c('div',{attrs:{\"id\":\"content\"}},[_c('vue-waterfall-easy',{ref:\"waterfall\",attrs:{\"imgsArr\":_vm.imgsArr},on:{\"scrollReachBottom\":_vm.getData,\"click\":_vm.clickFn,\"imgError\":_vm.imgErrorFn},scopedSlots:_vm._u([{key:\"default\",fn:function(props){return _c('div',{staticClass:\"img-info\"},[_c('p',{staticClass:\"some-info\"},[_vm._v(\"第\"+_vm._s(props.index+1)+\"张图片\")]),_c('p',{staticClass:\"some-info\"},[_vm._v(_vm._s(props.value.info))])])}}])})],1)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-3b528148\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/template-compiler/preprocessor.js?engine=pug!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-3b528148\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-3b528148\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/template-compiler/preprocessor?engine=pug!../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/App.vue\n// module id = null\n// module chunks = ","import Vue from 'vue'\nimport Router from 'vue-router'\n\nVue.use(Router)\nexport default new Router({\n routes: [\n {\n path: '/test',\n name: 'test',\n component: { name: 'test',template:'test test test test test test '}\n },\n ]\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/router/index.js","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport App from './App'\nimport router from './router'\nimport Promise from 'promise-polyfill'\n// To add to window\nif (!window.Promise) {\n window.Promise = Promise\n}\n/* eslint-disable no-new */\nnew Vue({\n el: '#app',\n router,\n template: ' ',\n components: { App }\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js"],"sourceRoot":""}
--------------------------------------------------------------------------------