Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether the element is already mounted #71

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"rules": {
"ban-ts-comment": 0,
"quotes": 0,
"camelcase": 0,
"no-underscore-dangle": 0,
"no-shadow": 2,
"no-unused-vars": 1,
"no-var": 1,
"no-console": 0,
"no-prototype-builtins": 0,
"no-mixed-requires": 0,
"eqeqeq": 0,
"indent": [0, 2],
"linebreak-style": [2, "unix"],
"semi": [2, "always"],
"vue/no-side-effects-in-computed-properties": 2,
"vue/no-mutating-props": 2,
"vue/no-async-in-computed-properties": 2,
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
]
},
"globals": {
"google": false,
"document": false,
"window": false,
"$": false
},
"parserOptions": {
"requireConfigFile": false,
"caller": {
"supportsTopLevelAwait": true
}
},
"env": {
"es6": true,
"jasmine": true,
"browser": true
},
"parser": "vue-eslint-parser",
"plugins": ["vue"],
"extends": [
"plugin:vue/essential",
"eslint:recommended",
"plugin:prettier/recommended",
"prettier"
],
"ignorePatterns": ["node_modules", ".github"]
}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@landtechnologies:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GITHUB_ACCESS_TOKEN}
44 changes: 18 additions & 26 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# vue-infinite-scroll
# @landtechnologies/vue-infinite-scroll

vue-infinite-scroll is an infinite scroll directive for vue.js.

# Install

```Bash
npm install vue-infinite-scroll --save
npm install @landtechnologies/vue-infinite-scroll --save
```

### CommonJS
Expand All @@ -14,11 +14,11 @@ You can use any build tool which supports `commonjs`:

```JavaScript
// register globally
var infiniteScroll = require('vue-infinite-scroll');
var infiniteScroll = require('@landtechnologies/vue-infinite-scroll');
Vue.use(infiniteScroll)

// or for a single instance
var infiniteScroll = require('vue-infinite-scroll');
var infiniteScroll = require('@landtechnologies/vue-infinite-scroll');
new Vue({
directives: {infiniteScroll}
})
Expand All @@ -29,28 +29,20 @@ Or in ES2015:

```JavaScript
// register globally
import infiniteScroll from 'vue-infinite-scroll'
import infiniteScroll from '@landtechnologies/vue-infinite-scroll'
Vue.use(infiniteScroll)

// or for a single instance
import infiniteScroll from 'vue-infinite-scroll'
import infiniteScroll from '@landtechnologies/vue-infinite-scroll'
new Vue({
directives: {infiniteScroll}
})

```

### Direct include

You can use the CDN: https://unpkg.com/vue-infinite-scroll, `infiniteScroll` is exposed to `window` and will automatically install itself. Also you can use your local copy:

```HTML
<script src="../node_modules/vue-infinite-scroll/vue-infinite-scroll.js"></script>
```

## Usage

Use v-infinite-scroll to enable the infinite scroll, and use infinite-scroll-* attributes to define its options.
Use v-infinite-scroll to enable the infinite scroll, and use infinite-scroll-\* attributes to define its options.

The method appointed as the value of v-infinite-scroll will be executed when the bottom of the element reaches the bottom of the viewport.

Expand Down Expand Up @@ -86,20 +78,20 @@ new Vue({

# Options

| Option | Description |
| ----- | ----- |
| infinite-scroll-disabled | infinite scroll will be disabled if the value of this attribute is true. |
| infinite-scroll-distance | Number(default = 0) - the minimum distance between the bottom of the element and the bottom of the viewport before the v-infinite-scroll method is executed. |
| infinite-scroll-immediate-check | Boolean(default = true) - indicates that the directive should check immediately after bind. Useful if it's possible that the content is not tall enough to fill up the scrollable container. |
| infinite-scroll-listen-for-event | infinite scroll will check again when the event is emitted in Vue instance. |
| infinite-scroll-throttle-delay | Number(default = 200) - interval(ms) between next time checking and this time |
| Option | Description |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| infinite-scroll-disabled | infinite scroll will be disabled if the value of this attribute is true. |
| infinite-scroll-distance | Number(default = 0) - the minimum distance between the bottom of the element and the bottom of the viewport before the v-infinite-scroll method is executed. |
| infinite-scroll-immediate-check | Boolean(default = true) - indicates that the directive should check immediately after bind. Useful if it's possible that the content is not tall enough to fill up the scrollable container. |
| infinite-scroll-listen-for-event | infinite scroll will check again when the event is emitted in Vue instance. |
| infinite-scroll-throttle-delay | Number(default = 200) - interval(ms) between next time checking and this time |

## Development

|Command|Description|
|---|---|
|npm run build|Build in umd format|
|npm test|Lint code|
| Command | Description |
| ------------- | ------------------- |
| npm run build | Build in umd format |
| npm test | Lint code |

# License

Expand Down
43 changes: 0 additions & 43 deletions bower.json

This file was deleted.

4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: "rollup-jest",
testEnvironment: "jsdom",
};
108 changes: 0 additions & 108 deletions karma.conf.js

This file was deleted.

Loading