https://github.com/phphe/vue-functions
https://github.com/phphe/vue-functions
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/phphe/vue-functions
- Owner: phphe
- License: mit
- Created: 2018-08-02T08:37:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T15:01:47.000Z (almost 2 years ago)
- Last Synced: 2025-01-10T21:07:50.658Z (about 1 year ago)
- Language: JavaScript
- Size: 209 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# vue-functions
# install
```sh
npm install vue-functions
```
# usage & api
```js
import * as vf from 'vue-functions'
vf.method(...)
```
# api
### updatablePropsEvenUnbound
```js
// eg 1
export default {
mixins: [vf.updatablePropsEvenUnbound({
value: {localName: 'current'},
})],
}
// eg 2
// if without localName, the localName will be 'localProps_' + prop name
export default {
mixins: [vf.updatablePropsEvenUnbound({
value: {},
})],
}
// eg 3
// if without localName, the localName will be 'localProps_' + prop name
export default {
mixins: [vf.updatablePropsEvenUnbound({
value: {},
page: {},
other: {},
})],
}
```
### watchAsync(vm, getter, handler, opt)
Watch a function and resolve dependences. The function can contain async dependences. There is no more doc, please check source.
### doWatch(vm, handler)
do handler first, handler return getter
### * iterateObjectWithoutDollarDash(obj)
Like name
### windowSize
Vue component, extend or mixin it to use. Get access to windowSize. The windowSize is reactive.
```js
windowSize: {
innerWidth: window.innerWidth,
innerHeight: window.innerHeight,
outerWidth: window.outerWidth,
outerHeight: window.outerHeight,
}
```
### registerPreventURLChange(Vue, router, msg)
Attach `$preventURLChange` and `$allowURLChange` to vm.
### hookHelper
Vue component, extend or mixin it to use. Help to extend hook.
```js
methods: {
addHook(name, func),
removeHook(name, func),
hasHook(name),
executeHook(name, args)
}
```