Coder Social home page Coder Social logo

yvescoding / vuescroll Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 111.0 4.46 MB

A customizable scrollbar plugin based on vue.js for PC , mobile phone, touch screen, laptop.

Home Page: https://vuescrolljs.yvescoding.me

License: MIT License

JavaScript 100.00%
component javascript scrollbar slide virtual-scrollbar vue vue-components vuescroll

vuescroll's People

Contributors

diomed avatar julianobailao avatar lchreal6 avatar lorado avatar rub3n88 avatar wangyi7099 avatar yufy1314 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuescroll's Issues

当高度为百分比的时候,不起作用

<template>
    <div id="app">
        <vue-scroll>
            <p v-for="item in 64">yo</p>
        </vue-scroll>
    </div>
</template>

<script>
export default {};
</script>

<style lang="less">
#app {
    height: 50%;
}
</style>

会出现浏览器的滚动条

Subpixel values of container width

When the wrapping container has witdth value in subpixels (eg. 500.25px), then applied gutter to minus right margin does not fully hide native scrollbar, while width values with decimal part above 0.5px work just fine.

No track color

Hey,

Just giving this a try, I have it working but I can not get a track to have a color. The bar color I can set, but not the track / rail it sits on.

Code:

vRail: {
          width: '5px',
          pos: 'right',
          railBackground: '#009688',
          railOpacity: 0.5
        },
        vBar: {
          background: '#00bcd4', // cyan
          deltaY: 30,
          keepShow: false,
          opacity: 1
        },

Any ideas?

Thanks
Dave

使用NUXT 服务端渲染时 报DOM错误

[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside

, or missing . Bailing hydration and performing full client-side render.

配置如下:
{ src: '~plugins/vuescroll', ssr: false },
ssr 是false

这个问题是因为服务端与客户端渲染的DOM结构不一样。出现的这个问题是vuescroll没有允许在服务端使用导致的。

但是如果改成true 就会报 window is not defined
因为服务端没有window

配置有些配置不上

我刚刚在我自己的vue-cli里测试了一下
1.rail
2.bar
3.全局设置
这些内容设置完了没有效果,我一开始以为是自己工程问题,然后在codepen上修改之后也没有效果

tips:在线demo网页打不开了,还有想请问下如何在vue-cli里全局设置参数

Nuxt Configuration

Do you know if this can work with Nuxt?

I created a vuescroll.js plugin

import Vue from 'vue'
import vuescroll from 'vuescroll'
Vue.use(vuescroll)

Added that to plugins: [{ src: '~/plugins/vuescroll.js', ssr: false }] in the nuxt.config

But I get the error "window is not defined"

Any ideas?

Thanks

<vue-scroll>还需要自己注册?

Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
@wangyi7099 这个插件怎么注册呢? 你的API里没有提到, 望大佬指点

列表为ajax返回数据,initialScrollY 该配置项为100%,不生效

version:4.5.27

<vue-scroll :ops="msgOps" ref="vs">
     <ul class="msglist">
           <msg-list v-for="(item, idx) in msglist" :key="idx"
                            :item="item"></msg-list>
     </ul>
</vue-scroll>

msglist为动态内容时,initialScrollY 该配置项为100%,偶尔生效,偶尔不生效。
我试着在API scrollTo 中通过vm.$nextTick 设置,依旧不生效。
不知道是不是我这样使用有问题

Last update introduces a bug on vuescroll-panel

On the last update, vuescroll-panel seems to not be set correctly, and the margin-right: -17px, used to hide the browser scollbar and the overflow-y: scroll, don't appear until you hover the panel, you can force the browser scrollbar to appear by refreshing the browser, be sure your mouse cursor is not hovering the panel.

That bug forced me to specify two those properties on my styles in order to fix it.

Chrome version: 61 (I'm using Electron)
OS: Windows

Should remove "import vue from 'vue'" from source code and in package.json use peerDependencies vue

Your config

Your Workaround

  • Browser:

  • Vuescroll Version(Try to update to the latest version may solve your problem):

  • OS:

What happened?
When build with webpack, vuescroll may self contained vue in its packed module,this is wrong.
Vuescroll as a plugin for Vue,just should has an install method with Vue as parameter is enough.But I saw import vue from 'vue' in the index.js from the source.For the problem import vue from 'vue' should be removed from the source code and in package.json use
"peerDependencies": { "vue": "^2.5.16" }, instead.

4.7.1-rc.10 Bug

Your config

Your Workaround

  • Browser:

  • Vuescroll Version(Try to update to the latest version may solve your problem):

  • OS:

What happened?
When we pass a percent to scrollTo api, it will eventually convert to numeric value. But the way of calculation is incorrect.
Before:

    var posY = 0.5 * container.scrollHeight; // Wrong
    scrollTo({y: posY});

Now:

   ar posY = 0.5 * (container.scrollHeight - container.clientHeight); // Right
    scrollTo({y: posY});

How to use it in AMD project

Describe your feature, thanks!
我想在我的dojo项目里引用组件,但是define进来并不能很好地使用,控制台报不能找到vue.js错误,我已经引用了vue.js。而且我的vue和vuex都是这样引用的,都运行的很好。
(I want to use this component in my Dojo (based on AMD) project, but I download the vuescroll.js and vuescroll.min.js and define it, but can not use it correctly, it will give me an 404 error, can not find vue.js)

What does this feature solve?
所以能不能提供一个可以在AMD标准下能用的组件啊,谢谢
So, could you please offer a version can be used in AMD project, like vue,min.js, vuex.min.js, they work well in Dojo, thanks.

Auto scroll on load

Hello,

I'm testing out VueScroll for a project I am currently working on to see if it fits. All is well, except I can't seem to find how to auto scroll to bottom of a div on component initialisation.

Is this possible? If yes, how?

Thank you.

This is my config :

      ops: {
        vuescroll: {
          mode: "native"
        },
        scrollPanel: {
          intialScrollY: true,
          intialScrollX: true,
          scrollingX: true,
          scrollingY: true,
          speed: 300
        }
      }

Issues after update

Your config
Default config

Your Workaround
Roll back to previous version

  • Browser:
    Chrome Version 67.0.3396.99

  • Vuescroll Version(Try to update to the latest version may solve your problem): 4.7.0

  • OS: macOS High Sierra 10.13.6

What happened?
Started to get console.warn()

[vuescroll] The options: vRail, hRail, vBar, hBar have been deprecated since v4.7.0,please use corresponing rail/bar instead!

PS. All the demo links and Documentation seems to be dead.

4.7.1-rc.5-bug

There is something wrong about 4.7.1-rc.5 , I'd fix it in next release.

scrollContent padding set to false doesn't work

I have a super basic scroll, the only setting I'm applying is:

ops: {
     scrollContent: {
     padding: false
   }
 }

The problem is that it doesn't get rid of the padding.
I can change other settings and see its effects, so I know I'm setting the ops correctly, it just seems the padding setting is being ignored.

发现一个体验非常差的地方,希望改进

环境:chrome55
描述:
鼠标mousedown的时候移动bar,有时候可能移动的不是那么水平或者垂直,导致鼠标小手的图标变成禁止的图标,这时鼠标移动,滚动条不动.然后鼠标mouseup,就可以控制滚动条的移动.体验非常不好,我已经出现过很多次这种操作了.

No scroll in Firefox

Firefox 59, Linux.

Going to the demo page, you can't scroll, and you don't see any scroll coming from Vue-scroll. Works fine in Chromium Linux.

Horizontal scroll without shift key

Hi! Thanks for a good plugin, it's realy good.

But I have a problem with horizontal scroll. Me need scroll horizontal content without shift key? Is it possible?

I didn't see a need parameter in the docs

Request for @types support

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Some .d.ts files would be appreciated.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

An alternative I have considered is writing those files by myself and open a pull request, which is not gonna happen.

Additional context
Add any other context or screenshots about the feature request here.

Actually you can reply to this issue in Chinese if you like.

与vuetable2一起使用时,vuetable2的fieds callback不能被渲染

Vue.component("myComponent", { template:



data(){ return { fields: [ {title: "", name:"id", visible: true, callback: "showDetailRow"}], ops: { vuescroll: { mode: "native", refreshEnable: false }, scrollPanel: { padding: true, easing: "easeInQuad", speed: 300, }, vBar: { background: "#000" }, hBar: { background: "#000" } } }, method : { showDetailRow(value){ var icon = this.$refs.vuetable.isVisibleDetailRow(value) ? 'glyphicon glyphicon-minus-sign' : 'glyphicon glyphicon-plus-sign'; return [ '<a class="show-detail-row" style="color: #ec971f;">', '<i class="' + icon + '"></i>', '</a>' ].join(''); }, } });

showDetailRow 不能被渲染

Q&A

If there are any technical problems, please comment here.

你好,设置全局配置无法生效呢?

我在main.js中配置全局无法生效?

是这么写么?

Vue.prototype.$vuescrollConfig = {
  hBar: {
    height: '5px',
    pos: 'bottom',
    background: 'red',
    keepShow: false,
    opacity: 1,
    hover: false
  }
}

Edge browser support

Hello

Looks like there's an issue on Edge. The scroll appears, but the content is not hidden. It overflows.
Works fine on Chrome/Firefox/IE11. 🤔

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.