GithubHelp home page GithubHelp logo

lfyfly / vue-waterfall-easy Goto Github PK

View Code? Open in Web Editor NEW
850.0 13.0 352.0 2.58 MB

vue瀑布流组件(vue-waterfall-easy 2.x)

Home Page: https://lfyfly.github.io/vue-waterfall-easy/demo/#/

License: MIT License

JavaScript 46.47% HTML 0.97% Vue 51.58% CSS 0.98%
waterfall vue-waterfall-easy vue vue-waterfall

vue-waterfall-easy's Issues

default slot中放置自定义的组件

现在的imgsArr中每个元素都要有src和href,我已经让每个元素有这两个属性了,不过除了这两个属性之外,还有很多其他属性,而基于每个元素里面的各种属性,我需要用自己的组件来呈现。
所以我希望把自定义组件放到默认的slot中,但是我看了例子并不知道如何把imgsArr中的当前元素传递到这个位置,而这个props里面好像也只有一个index属性。
<vue-waterfall-easy :imgsArr="imgsArr" @scrollReachBottom="getData"> <my-component class="img-info" slot-scope="props"> //???? </my-component> </vue-waterfall-easy>

请指教,多谢!

不能显示图片

我在那种切换的列表,上面是一个切换列表,下面根据切换内容,切换子组件,但是子组件被盖住,不显示图片[图片]

相对路径图片引用不成功

1.vue-cli创建的项目,我把图片放到src里面 展示不了图片,放到static里面就可以,是怎么回事呢
2. 还有info怎么去掉 我在页面内重写了css,覆盖不了

建议 height 属性更灵活点

看了源码,height 只能传递数字(实际单位是像素),有点不方便。
可能有的需求是想设置 90vh,或者 100rem ,或者 calc(100vh - 200px)

h5页面,生成的页面底部栏太宽,显示出横向的滚动条出来了

如题,我遇到的问题是在开发h5页面时,用组件动态生成的页面中,会扩宽底部栏,把.vue-waterfall-easy所在的dom撑开,显示出横向的滚动条出来。我自己的解决办法是把宽度 width: 100%改成 width: 99.9%就好了。如下代码:

.vue-waterfall-easy {
  position: relative;
  width: 99.9%; // 移动端生效
}

我这个渣渣,按教程在vue里面一步一步写,全写完了,没报错,但是啥东西也没出来,console.log(res.data)也有数据出来

我这个渣渣,按教程在vue里面一步一步写,全写完了,没报错,但是啥东西也没出来,console.log(res.data)也有数据出来
(20) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0
:
href
:
(...)
info
:
"一些图片描述文字"
src
:
(...)
_height
:
251
ob
:
Observer {value: {…}, dep: Dep, vmCount: 0}
get href
:
ƒ reactiveGetter()

waterfall-over 的top 值不对,

waterfall-over

waterfall-over 的top值,在倒数第二个的位置,

正常应该在倒数第一个的top位置吧?

"vue-waterfall-easy": "^2.2.2",

有个小bug

滚动触底事件中有个小bug,部分极端高度下会发生,需要将判断条件修改下
image

TypeError: Cannot read property 'src' of undefined

用的npm 的方式安装的vue-waterfall-easy,然后按照Basic example方式实现,运行时候控制台报错:
TypeError: Cannot read property 'src' of undefined
at eval (vueWaterfallEasy.js?6dc5:1)
at Array.forEach ()
at VueComponent.preload (vueWaterfallEasy.js?6dc5:1)
at VueComponent.imgsArr (vueWaterfallEasy.js?6dc5:1)
at Watcher.run (vue.esm.js?a026:3233)
at flushSchedulerQueue (vue.esm.js?a026:2981)
at Array.eval (vue.esm.js?a026:1837)
at flushCallbacks (vue.esm.js?a026:1758)

因为是初学者,不知道是不是缺少什么package的问题,还请麻烦解惑,谢谢

图片比例没有传参控制么?

我们的功能是用户可以上传图片,为保证图片规范性,我们可能会需要限制图片最大或最小比例,这个功能应该向插件传什么参数呢?

import plugin error

hi
thansk for your plugin but when i use this, it's occur an error in
#error (compile error)
in .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./~/vue-waterfall-easy/src/vue-waterfall-easy/vue-waterfall-easy.vue
Module build failed: ReferenceError: Unknown plugin "transform-vue-jsx" specified in "my file path"
node_modules/vue-waterfall-easy/.babelrc" at 0, attempted to resolve relative to "/node_modules/vue-waterfall-easy"
at /node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
at Array.map (native)
at Function.normalisePlugins (//node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init /node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (//node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transpile (/node_modules/babel-loader/lib/index.js:49:20)

waiting your apply thanks

PROP的imgsArr默认值要用函数返回。

Invalid default value for prop "imgsArr": Props with type Object/Array must use a factory function to return the default value.
官方文档写的:
// 对象或数组且一定会从一个工厂函数返回默认值

imgsArr和loadingDotStyle必须用函数返回。
loadingDotStyle: { type: Object, default: function () { return null; } },
imgsArr: { type: Array, required: true, default: function () { return []; } },

图片可否支持懒加载

因为有些图片尺寸较大,先拿图片再加载有点慢,可否支持懒加载,或者说可以把img标签以slot暴露出来,我们自己做懒加载

请问模板语法能换成vue默认的嘛?

Module build failed: ReferenceError: Unknown plugin "transform-vue-jsx" specified in "E:\Testing\mp-kite\node_modules\vue-waterfall-easy\.babelrc" at 0, attempted to resolve relative to "E:\Testing\mp-kite\node_modules\vue-waterfall-easy"
at E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\options\option-manager.js:180:17
at Array.map (native)
at Function.normalisePlugins (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
at OptionManager.mergeOptions (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
at OptionManager.init (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (E:\Testing\mp-kite\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (E:\Testing\mp-kite\node_modules\babel-loader\lib\index.js:50:20)
at Object.module.exports (E:\Testing\mp-kite\node_modules\babel-loader\lib\index.js:173:20)

@ .//vue-waterfall-easy/src/vue-waterfall-easy/vue-waterfall-easy.vue 8:0-123
@ ./
/babel-loader/lib!./~/mpvue-loader/lib/selector.js?type=script&index=0!./src/pages/find-list/find-list.vue
@ ./src/pages/find-list/find-list.vue
@ ./src/pages/find-list/main.js

由于该组件使用了jsx语法,导致运行出错

img error

请问下图片加载失败的情况,图片的高度怎么算的

TypeError: Cannot read property 'forEach' of undefined

我在使用这个插件的时候遇到这个错误,已经好多天了,一直解决不了。
这是我的代码:
<script>
new Vue({
el: "#app",
components: {
vueWaterfallEasy
},
data() {
return {
imgsArr: [],
fechImgsArr: [],
group: 1,
}
},
methods: {
getData () {
axios.get("http://122.114.227.186:8080/" + this.group)
.then(res => {
this.imgsArr = res.data
this.group++
console.log(res.data)
})
},
},
created() {
this.getData()
}
})
</script>
这是我的后端返回的json:
image
这是chrome console下的结果:
image
可以看到res.data是有Array(0)属性的。
我查了很久的google,不管是用for in重组数组还是重写后端返回的json都解决不了这个问题,我很烦恼,各位大大能帮忙看一下吗?

怎麼設置圖片的寬度?

大佬設置圖片寬度怎麼沒起效果?求教一下,謝謝。

data() {
return {
//圖片大小
imgsWidth: 80, }

Update list

加载新的数据后,列表数据会重新reload

bug:
触发scrollReachBottom方法时候,调用this.imgsArr = this.imgsArr.concat(tempData);
会导致数据重新加载,滚动条默认回到顶部。

新版2.4.2存在此问题,旧版本2.1.9正常

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.