Skip to content

Commit

Permalink
Remove 'idle-vue' component from base build
Browse files Browse the repository at this point in the history
  • Loading branch information
GregPeden committed Mar 3, 2018
1 parent 1cae9ac commit 5387f1e
Show file tree
Hide file tree
Showing 7 changed files with 9,794 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

#PHPStorm config files
.idea

# End of https://www.gitignore.io/api/windows,osx,linux,node
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ Vue.use(IdleVue, options)

`Vue.use` is a Vue method that installs the given plugin (here, IdleVue), and passes it the given options.

The above code does three things:
The above code does two things:

* Add two hooks `onIdle` and `onActive` to all Vue objects

* Add a computed value `isAppIdle` to all Vue objects

* Create an `idle-view` component in every Vue object

### Hooks

The plug-in adds two hooks to Vue: `onIdle` and `onActive`; those functions may be defined in any Vue object (components included), and will be called by the plug-in when the window respectively starts and stops idling.
Expand Down Expand Up @@ -123,18 +121,17 @@ const vm = new Vue({

### IdleView

The plug-in also adds a component named `IdleView` (or `idle-view`) to Vue.
The package comes with an example component named `IdleView` (or `idle-view`).

`idle-view` is automatically available in every Vue component once `Vue.use(IdleVue, ...)` is called; it can be used without using the `components` parameter.
`idle-view` is not automatically included with the plugin. It can be imported as a global component or a dependency within your own component, however it serves best as a working example from which to base your own implementation.

This component is a default idle overlay with a small "touch the screen" sprite; it has no props and no slots. You may create your own idle overlay by exploiting `isAppIdle`.

This component will *not* be added if the `options` object has no `store` field.

#### Example - `main.js`

``` js
import IdleVue from 'idle-vue'
import IdleVueComponent from 'idle-vue/src/components/Idle.vue'
import Vuex from 'vuex'

const eventsHub = new Vue()
Expand All @@ -143,6 +140,7 @@ const store = new Vuex.Store({
})

Vue.use(IdleVue, { eventEmitter: eventsHub, store })
Vue.component('idle-view', IdleVueComponent) // Required only to use idle-view component

const vm = new Vue({
el: '#app',
Expand Down
2 changes: 1 addition & 1 deletion dist/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/build.js.map

Large diffs are not rendered by default.

Binary file removed dist/static/img/touch.ba3be66.png
Binary file not shown.
Loading

0 comments on commit 5387f1e

Please sign in to comment.