{"id":13424268,"url":"https://github.com/suguangwen/vue-scroll","last_synced_at":"2025-03-15T18:34:30.226Z","repository":{"id":143927118,"uuid":"56024681","full_name":"suguangwen/vue-scroll","owner":"suguangwen","description":"vue scroll which can work.","archived":false,"fork":false,"pushed_at":"2016-05-19T06:38:16.000Z","size":15,"stargazers_count":41,"open_issues_count":4,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T12:02:12.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suguangwen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-04-12T02:36:05.000Z","updated_at":"2022-03-24T04:04:53.000Z","dependencies_parsed_at":"2024-01-17T22:13:54.280Z","dependency_job_id":"df8b3863-ecfd-4c37-b93b-cf5c1b12def7","html_url":"https://github.com/suguangwen/vue-scroll","commit_stats":null,"previous_names":["suguangwen/vue-rolling"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suguangwen%2Fvue-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suguangwen%2Fvue-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suguangwen%2Fvue-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suguangwen%2Fvue-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suguangwen","download_url":"https://codeload.github.com/suguangwen/vue-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775802,"owners_count":20346266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T00:00:51.033Z","updated_at":"2025-03-15T18:34:25.198Z","avatar_url":"https://github.com/suguangwen.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","JavaScript","UI组件","Awesome Vue.js"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"# vue-scroll\nvue scroll which can work.\n\n\n借鉴于ElemeFE/vue-infinite-scroll．\n重新设计了核心算法．\n将持续更新和添加与滚动有关的效果\n\n\n＠TODO 增加环境与测试用例．\n\n# 安装//Install\n\n```npm\nnpm install vue_scroll --save\n```\n\n###ES6\n\n```JavaScript\nimport vue_scroll from 'vue_scroll'\nVue.use(vue_scroll)\n```\n\n###CommonJS\n\n```JavaScript\nvar vue_scroll =  require('vue_scroll');\nVue.use(vue_scroll)\n```\n\n###直接引用//Direct include\n\n```JavaScript\n\u003cscript src=\"../node_modules/vue_scroll/vue_scroll.js\"\u003e\u003c/script\u003e\n```\n\n# 使用方法//Usage\n\nUse v-scroll to enable the infinite scroll, and use scroll-* attributes to define its options.\n\n使用v-scroll进行滚动翻页,使用 scroll- * 属性来定义它的选项。\n\n```HTML\n\u003cdiv v-scroll=\"down()\" scroll-foot=\"500\" scroll-top=\"200\" scroll-up=\"up()\"\u003e\n\n\u003c/div\u003e\n```\n\n```JavaScript\n  new Vue({\n    el: 'body',\n    data: function () {\n      return {a: [], b: []}\n    },\n    methods: {\n      down: function () {\n         //当滚动条距离底部高度小于或等于你在scroll-foot设置的高度时将运行一次此函数\n         //if scrollFoot height \u003c= scroll-foot , function run.\n        for (var i = this.a.length; i \u003c this.b.length; i++) {\n          this.a.push(this.b[i])\n          if (i % 6 === 5) {\n            break\n          }\n        }\n      },\n      up: function () {\n        //当滚动条距离顶部高度小于或等于你在scroll-top设置的高度时将运行一次此函数\n        //if scrollTop height \u003c= scroll-top , function run.\n      }\n    },\n    ready: function () {\n      //滚动翻页实例（请按照自己的需要去修改）\n      //scroll the instance.\n      $.ajax({\n          url: '#',\n          type: 'get',\n          success: function (res) {\n            if (res.status === 200) {\n              // 初始化数据 先获取所有数据并初始化前６条\n              //Initialize the data,get 0-6 data of the array.\n              this.$set('b', res.data)\n              for (var i = 0; i \u003c 6; i++) {\n                this.a.push(this.b[i])\n              }\n            }\n          }\n        })\n    }\n  })\n```\n\n# 选项//Options\n\n| scroll/Option | Description |\n| ----- | ----- |\n| scroll-foot | 数字(默认为０)：设定滚动条距离底部的高度．// Number(default = 0)：Set the height of the scroll bar at the bottom of the distance. |\n| scroll-top | 数字(默认为０)：设定滚动条距离顶部的距离．// Number(default = 0)：Set the height of the scroll bar at the top of the distance. |\n| scroll-up | 设定滚动条往上回滚时触发的函数．// When setting a scroll bar to rollback trigger function. |\n| scroll-initialize | 布尔(默认为false)：设定为true时将在页面加载完成后触发一次v-scroll设定的函数．// Boolean(default = false)：After completion of the page load when set to true will trigger a v-scroll set function. |\n\n# License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuguangwen%2Fvue-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuguangwen%2Fvue-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuguangwen%2Fvue-scroll/lists"}