diff --git a/dist/vuet.js b/dist/vuet.js index 6caf622..a52b5af 100644 --- a/dist/vuet.js +++ b/dist/vuet.js @@ -223,7 +223,7 @@ var VuetScroll = function () { _this[key] = setTimeout(function () { Object.assign(_this.scrolls, newScrolls); delete _this[key]; - }, 30); + }, 10); }; app.addEventListener('scroll', this.subScrolling, false); } diff --git a/dist/vuet.js.map b/dist/vuet.js.map index dc8ed5e..6e5b107 100644 --- a/dist/vuet.js.map +++ b/dist/vuet.js.map @@ -1 +1 @@ -{"version":3,"file":"vuet.js","sources":["../src/utils.js","../src/debug.js","../src/directives/scroll.js","../src/install.js","../src/rules/life.js","../src/rules/manual.js","../src/rules/need.js","../src/rules/once.js","../src/rules/route.js","../src/rules/index.js","../src/vuet.js","../src/index.js"],"sourcesContent":["const toString = Object.prototype.toString\n// Cached type string\nconst typeStrings = ['Object', 'Function', 'String', 'Undefined', 'Null']\n\nconst utils = {\n getArgMerge () {\n let opt = {}\n const args = arguments\n if (utils.isString(args[0])) {\n opt[args[0]] = args.length > 1 ? args[1] : args[0]\n } else if (args[0] && utils.isObject(args[0])) {\n opt = args[0]\n }\n return opt\n },\n set (obj, key, value) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: false,\n writable: true,\n configurable: false\n })\n }\n}\n\n// Add isXXX function\ntypeStrings.forEach(type => {\n const typeString = `[object ${type}]`\n utils[`is${type}`] = obj => {\n return toString.call(obj) === typeString\n }\n})\n\nexport default utils\n","export default {\n error (msg) {\n throw new Error(`[vuet] ${msg}`)\n },\n warn (msg) {\n if (process.env.NODE_ENV !== 'production') {\n typeof console !== 'undefined' && console.warn(`[vuet] ${msg}`)\n }\n }\n}\n","import { _Vue } from '../install'\nimport debug from '../debug'\n\nconst _self = '__vuetScrollSelf__'\nconst _window = '__vuetScrollWindow__'\n\nclass VuetScroll {\n constructor (opt) {\n this.app = null\n this.path = null\n this.name = null\n this.store = null\n this.scrolls = null\n this.setOption(opt)\n this.scrollTo()\n this.subScroll()\n }\n update (opt) {\n this.setOption(opt)\n this.scrollTo()\n }\n destroy () {\n this.app.removeEventListener('scroll', this.subScrolling, false)\n }\n setOption (opt) {\n this.app = opt.app\n this.path = opt.path\n this.name = opt.name || null\n this.store = opt.store || null\n this.scrolls = opt.scrolls || createScroll(opt)\n function createScroll (opt) {\n if (!opt.store.$scroll) {\n _Vue.set(opt.store, '$scroll', {})\n }\n if (!opt.store.$scroll[opt.name]) {\n _Vue.set(opt.store.$scroll, opt.name, { x: 0, y: 0 })\n }\n\n return opt.store.$scroll[opt.name]\n }\n }\n scrollTo () {\n const { app, scrolls } = this\n if ('scrollTop' in app && app !== window) {\n app.scrollLeft = scrolls.x\n app.scrollTop = scrolls.y\n } else {\n app.scrollTo(scrolls.x, scrolls.y)\n }\n }\n subScroll () {\n const { app } = this\n const newScrolls = {}\n this.subScrolling = event => {\n if (app === window) {\n newScrolls.x = window.pageXOffset\n newScrolls.y = window.pageYOffset\n } else {\n const { scrollTop, scrollLeft, pageXOffset, pageYOffset } = event.target\n newScrolls.x = scrollLeft || pageYOffset || scrollLeft\n newScrolls.y = scrollTop || pageXOffset || scrollTop\n }\n const key = `timer-${this.path}-${this.name}`\n clearTimeout(this[key])\n this[key] = setTimeout(() => {\n Object.assign(this.scrolls, newScrolls)\n delete this[key]\n }, 30)\n }\n app.addEventListener('scroll', this.subScrolling, false)\n }\n}\n\nfunction isSelf (modifiers) {\n return modifiers.window !== true || modifiers.self\n}\n\nfunction isWindow (modifiers) {\n return modifiers.window\n}\n\nexport default {\n inserted (el, { modifiers, value }, vnode) {\n if (typeof value.path !== 'string') return debug.error('path is imperative parameter and is string type')\n if (value.path === 'window') return debug.error('name cannot be the window name')\n if (isSelf(modifiers)) {\n if (typeof value.name !== 'string') return debug.error('name is imperative parameter and is string type')\n el[_self] = new VuetScroll({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window] = new VuetScroll({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n componentUpdated (el, { modifiers, value }, vnode) {\n if (isSelf(modifiers)) {\n el[_self].update({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window].update({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n unbind (el, { modifiers }) {\n if (isSelf(modifiers)) {\n el[_self].destroy()\n delete el[_self]\n }\n if (isWindow(modifiers)) {\n el[_window].destroy()\n delete el[_window]\n }\n }\n}\n","import utils from './utils'\nimport scroll from './directives/scroll'\n\nexport let _Vue = null\n\nexport default function install (Vue) {\n if (install.installed) return\n install.installed = true\n _Vue = Vue\n Object.defineProperty(Vue.prototype, '$vuet', {\n get () { return this.$root._vuet }\n })\n Vue.mixin({\n beforeCreate () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet._init(this)\n }\n },\n destroyed () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet.destroy(this)\n }\n }\n })\n Vue.directive('vuet-scroll', scroll)\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n },\n destroyed () {\n this.$vuet.reset(path, { current: this })\n }\n }\n }\n}\n","export default {\n rule ({ path, name }) {\n return {\n beforeCreate () {\n const { manuals = {} } = this.$vuet._options.modules[path]\n const methods = {}\n Object.keys(manuals).forEach(k => {\n const fn = manuals[k]\n if (typeof fn === 'function') {\n methods[`${k}`] = (...arg) => {\n return fn.apply(methods, [{\n state: this.$vuet.getState(path),\n vm: this,\n vuet: this.$vuet\n }, ...arg])\n }\n }\n })\n methods.reset = (...arg) => {\n return this.$vuet.reset(path, ...arg)\n }\n methods.fetch = (...arg) => {\n return this.$vuet.fetch(path, ...arg)\n }\n if (name) {\n this[name] = methods\n } else if (manuals.name) {\n this[manuals.name] = methods\n } else {\n const arr = path.split(this.$vuet._options.pathJoin)\n const name = `$${arr[arr.length - 1]}`\n const $methods = this[name] = {}\n Object.assign($methods, methods)\n }\n }\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n }\n }\n }\n}\n","import utils from '../utils'\n\nconst name = 'once'\nconst key = `__${name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, key, {})\n Object.keys(vuet.store).forEach(k => {\n utils.set(vuet[key], k, false)\n })\n },\n rule ({ path }) {\n return {\n beforeCreate () {\n if (this.$vuet[key][path] === false) {\n this.$vuet.fetch(path, { current: this }).then(() => {\n this.$vuet[key][path] = true\n })\n }\n }\n }\n }\n}\n","import utils from '../utils'\n\nexport const _name = 'route'\nexport const _key = `__${_name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, _key, {\n watchers: {},\n scrolls: {}\n })\n Object.keys(vuet.store).forEach(path => {\n utils.set(vuet[_key].watchers, path, [])\n utils.set(vuet[_key].scrolls, path, {})\n })\n },\n rule ({ path }) {\n // vuet-scroll\n function resetVuetScroll (vm) {\n const { $scroll } = vm.$vuet.store[path]\n if ($scroll) {\n Object.keys($scroll).forEach(k => {\n $scroll[k].x = 0\n $scroll[k].y = 0\n $scroll[k].count = $scroll[k].count ? ++$scroll[k].count : 0\n })\n }\n }\n\n // route-watch\n function getVuetWatchs (vuet) {\n return vuet[_key].watchers[path]\n }\n function setVuetWatchs (vuet, val) {\n vuet[_key].watchers[path] = val\n }\n function getWatchs (obj = {}, list) {\n if (typeof list === 'string') {\n list = [list]\n }\n const getObjVal = (obj, str) => {\n const arr = str.split('.')\n arr.forEach(k => {\n obj = obj[k]\n })\n return obj\n }\n const arr = []\n list.forEach(val => {\n let value = getObjVal(obj, val)\n if (!isNaN(value)) {\n value = String(value)\n }\n arr.push(JSON.stringify(value))\n })\n return arr\n }\n\n function diffWatch (to, from) {\n for (let i = 0; i < to.length; i++) {\n if (to[i] !== from[i]) {\n return true\n }\n }\n return false\n }\n\n return {\n beforeCreate () {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(this.$route, routeWatch)\n const watch = diffWatch(toWatch, getVuetWatchs(this.$vuet))\n if (watch) {\n this.$vuet.reset(path)\n setVuetWatchs(this.$vuet, toWatch)\n resetVuetScroll(this)\n }\n this.$vuet.fetch(path, { current: this, routeWatch: watch }, false).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n },\n watch: {\n $route: {\n deep: true,\n handler (to, from) {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(to, routeWatch)\n const fromWatch = getWatchs(from, routeWatch)\n const watch = diffWatch(toWatch, fromWatch)\n if (!watch) return false\n this.$vuet.fetch(path, { current: this, routeWatch: watch }).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n resetVuetScroll(this)\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n }\n }\n }\n }\n }\n}\n","import life from './life'\nimport manual from './manual'\nimport need from './need'\nimport once from './once'\nimport route from './route'\n\nexport default function install (_Vue, Vuet) {\n Vuet\n .rule('life', life)\n .rule('manual', manual)\n .rule('need', need)\n .rule('once', once)\n .rule('route', route)\n}\n","import install, { _Vue } from './install'\nimport utils from './utils'\nimport debug from './debug'\nimport rules from './rules/index'\n\nexport default class Vuet {\n constructor (options) {\n if (!_Vue) {\n debug.error('must call Vue.use(Vuet) before creating a store instance')\n }\n if (typeof Promise === 'undefined') {\n debug.error('Vuet requires a Promise polyfill in this browser')\n }\n if (!utils.isObject(options)) {\n debug.error('Parameter is the object type')\n }\n this.options = options || {}\n this.app = null\n this.store = {}\n this.beforeHooks = [] // Before the request begins\n this.afterHooks = [] // After the request begins\n this.vm = null\n }\n beforeEach (fn) {\n this.beforeHooks.push(fn)\n return this\n }\n afterEach (fn) {\n this.afterHooks.push(fn)\n return this\n }\n _init (app) {\n if (this.app || !app) return\n this.app = app\n this.vm = new _Vue({\n data: {\n store: this.store\n }\n })\n this._options = {\n data: function data () { return {} },\n pathJoin: null,\n ...this.options,\n ...{\n modules: {}\n }\n }\n const keys = ['data', 'fetch', 'routeWatch', 'manuals']\n const { pathJoin } = this._options\n const initModule = (path, modules) => {\n Object.keys(modules).forEach(k => {\n const item = modules[k]\n const _path = [...path, k]\n if (utils.isFunction(item.data)) {\n let newPath = null\n if (pathJoin) {\n newPath = _path.join(pathJoin)\n } else {\n newPath = [_path[0]]\n for (let i = 1; i < _path.length; i++) {\n newPath.push(_path[i].replace(/^(\\w)/, (v) => v.toUpperCase()))\n }\n newPath = newPath.join('')\n }\n this._options.modules[newPath] = item\n this.reset(newPath)\n }\n if (keys.indexOf(k) === -1 && utils.isObject(item)) {\n initModule(_path, item)\n }\n })\n }\n initModule([], this.options.modules)\n callRuleHook('init', this)\n }\n getState (path) {\n return this.store[path] || {}\n }\n setState (path, newState) {\n if (!utils.isObject(newState)) return this\n if (!this.store[path]) {\n _Vue.set(this.store, path, newState)\n return this\n }\n Object.assign(this.store[path], newState)\n return this\n }\n fetch (path, params, setStateBtn) {\n const module = this._options.modules[path]\n if (typeof module.fetch !== 'function') return Promise.resolve(this.getState(path))\n const data = {\n path,\n params: { ...params },\n state: this.getState(path),\n route: this.app.$route || {},\n app: this.app\n }\n const callHook = (hook, ...arg) => {\n for (let i = 0; i < this[hook].length; i++) {\n if (this[hook][i].apply(this, arg)) {\n return false\n }\n }\n }\n if (callHook('beforeHooks', data) === false) return Promise.resolve(data.state)\n return module.fetch.call(this, data)\n .then(res => {\n if (callHook('afterHooks', null, data, res) === false) return data.state\n if (setStateBtn === false) return res\n this.setState(path, res)\n return data.state\n })\n .catch(e => {\n if (callHook('afterHooks', e, data) === false) return Promise.resolve(data.state)\n return Promise.reject(e)\n })\n }\n reset (path) {\n const data = this._options.data.call(this)\n const module = this._options.modules[path]\n if (utils.isFunction(module.data)) {\n Object.assign(data, module.data.call(this, path))\n }\n this.setState(path, data)\n return this\n }\n destroy () {\n this.vm.$destroy()\n callRuleHook('destroy', this)\n }\n}\n\nObject.assign(Vuet, {\n options: {\n rules: {}\n },\n install,\n rule (name, rule) {\n if (this.options.rules[name]) return this\n this.options.rules[name] = rule\n callRuleHook('install', _Vue, Vuet)\n return this\n },\n mapRules (...paths) {\n const opt = utils.getArgMerge.apply(null, arguments)\n const vueRules = []\n const addRule = (ruleName, any) => {\n const rules = Vuet.options.rules[ruleName]\n if (typeof any === 'string') {\n vueRules.push(rules.rule({ path: any }))\n } else {\n vueRules.push(rules.rule(any))\n }\n }\n Object.keys(opt).forEach(ruleName => {\n const any = opt[ruleName]\n if (Array.isArray(any)) {\n return any.forEach(item => {\n addRule(ruleName, item)\n })\n }\n addRule(ruleName, any)\n })\n return {\n mixins: vueRules\n }\n },\n mapModules () {\n const opt = utils.getArgMerge.apply(null, arguments)\n const computed = {}\n Object.keys(opt).forEach(k => {\n const path = opt[k]\n computed[k] = {\n get () {\n return this.$vuet.store[path]\n },\n set (val) {\n this.$vuet.store[path] = val\n }\n }\n })\n return { computed }\n },\n use (plugin, opt) {\n if (utils.isFunction(plugin)) {\n plugin(_Vue, Vuet, opt)\n } else if (utils.isFunction(plugin.install)) {\n plugin.install(_Vue, Vuet, opt)\n }\n return this\n }\n})\n\nfunction callRuleHook (hook, ...arg) {\n const { rules } = Vuet.options\n for (let k in rules) {\n if (utils.isFunction(rules[k][hook])) {\n rules[k][hook].apply(rules[k], arg)\n }\n }\n}\n\nVuet.use(rules)\n","import Vuet from './vuet'\n\nexport const mapRules = Vuet.mapRules.bind(Vuet)\nexport const mapModules = Vuet.mapModules.bind(Vuet)\n\nexport default Vuet\n"],"names":["toString","Object","prototype","typeStrings","utils","opt","args","arguments","isString","length","isObject","obj","key","value","defineProperty","forEach","typeString","type","call","msg","Error","process","env","NODE_ENV","console","warn","_self","_window","VuetScroll","app","path","name","store","scrolls","setOption","scrollTo","subScroll","removeEventListener","subScrolling","createScroll","$scroll","set","x","y","window","scrollLeft","scrollTop","newScrolls","pageXOffset","pageYOffset","event","target","setTimeout","assign","addEventListener","isSelf","modifiers","self","isWindow","el","vnode","debug","error","context","$vuet","update","destroy","_Vue","install","Vue","installed","$root","_vuet","mixin","isUndefined","$options","vuet","_init","directive","scroll","fetch","current","reset","_options","modules","manuals","methods","keys","fn","k","arg","apply","getState","arr","split","pathJoin","$methods","then","_name","_key","watchers","resetVuetScroll","vm","count","getVuetWatchs","setVuetWatchs","val","getWatchs","list","getObjVal","str","isNaN","String","push","JSON","stringify","diffWatch","to","from","i","routeWatch","toWatch","$route","watch","res","setState","fromWatch","Vuet","rule","life","manual","need","once","route","options","Promise","beforeHooks","afterHooks","data","initModule","item","_path","isFunction","newPath","join","replace","v","toUpperCase","indexOf","newState","params","setStateBtn","module","resolve","callHook","hook","state","catch","e","reject","$destroy","rules","paths","getArgMerge","vueRules","addRule","ruleName","any","Array","isArray","computed","plugin","callRuleHook","use","mapRules","bind","mapModules"],"mappings":";;;;;;AAAA,IAAMA,WAAWC,OAAOC,SAAP,CAAiBF,QAAlC;;AAEA,IAAMG,cAAc,CAAC,QAAD,EAAW,UAAX,EAAuB,QAAvB,EAAiC,WAAjC,EAA8C,MAA9C,CAApB;;AAEA,IAAMC,QAAQ;aAAA,yBACG;QACTC,MAAM,EAAV;QACMC,OAAOC,SAAb;QACIH,MAAMI,QAAN,CAAeF,KAAK,CAAL,CAAf,CAAJ,EAA6B;UACvBA,KAAK,CAAL,CAAJ,IAAeA,KAAKG,MAAL,GAAc,CAAd,GAAkBH,KAAK,CAAL,CAAlB,GAA4BA,KAAK,CAAL,CAA3C;KADF,MAEO,IAAIA,KAAK,CAAL,KAAWF,MAAMM,QAAN,CAAeJ,KAAK,CAAL,CAAf,CAAf,EAAwC;YACvCA,KAAK,CAAL,CAAN;;WAEKD,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D2B;;qCAALvE,GAAK;OAAA;;;OAE9B,IAAID,CAAT,IAAcwE,KAAd,EAAqB;QACf7J,MAAM0I,UAAN,CAAiBmB,MAAMxE,CAAN,EAASkE,IAAT,CAAjB,CAAJ,EAAsC;YAC9BlE,CAAN,EAASkE,IAAT,EAAehE,KAAf,CAAqBsE,MAAMxE,CAAN,CAArB,EAA+BC,GAA/B;;;;;AAKNqC,OAAK8C,GAAL,CAASZ,SAAT;;ACxMO,IAAMa,WAAW/C,OAAK+C,QAAL,CAAcC,IAAd,CAAmBhD,MAAnB,CAAjB;AACP,AAAO,IAAMiD,aAAajD,OAAKiD,UAAL,CAAgBD,IAAhB,CAAqBhD,MAArB,CAAnB,CAEP;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"vuet.js","sources":["../src/utils.js","../src/debug.js","../src/directives/scroll.js","../src/install.js","../src/rules/life.js","../src/rules/manual.js","../src/rules/need.js","../src/rules/once.js","../src/rules/route.js","../src/rules/index.js","../src/vuet.js","../src/index.js"],"sourcesContent":["const toString = Object.prototype.toString\n// Cached type string\nconst typeStrings = ['Object', 'Function', 'String', 'Undefined', 'Null']\n\nconst utils = {\n getArgMerge () {\n let opt = {}\n const args = arguments\n if (utils.isString(args[0])) {\n opt[args[0]] = args.length > 1 ? args[1] : args[0]\n } else if (args[0] && utils.isObject(args[0])) {\n opt = args[0]\n }\n return opt\n },\n set (obj, key, value) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: false,\n writable: true,\n configurable: false\n })\n }\n}\n\n// Add isXXX function\ntypeStrings.forEach(type => {\n const typeString = `[object ${type}]`\n utils[`is${type}`] = obj => {\n return toString.call(obj) === typeString\n }\n})\n\nexport default utils\n","export default {\n error (msg) {\n throw new Error(`[vuet] ${msg}`)\n },\n warn (msg) {\n if (process.env.NODE_ENV !== 'production') {\n typeof console !== 'undefined' && console.warn(`[vuet] ${msg}`)\n }\n }\n}\n","import { _Vue } from '../install'\nimport debug from '../debug'\n\nconst _self = '__vuetScrollSelf__'\nconst _window = '__vuetScrollWindow__'\n\nclass VuetScroll {\n constructor (opt) {\n this.app = null\n this.path = null\n this.name = null\n this.store = null\n this.scrolls = null\n this.setOption(opt)\n this.scrollTo()\n this.subScroll()\n }\n update (opt) {\n this.setOption(opt)\n this.scrollTo()\n }\n destroy () {\n this.app.removeEventListener('scroll', this.subScrolling, false)\n }\n setOption (opt) {\n this.app = opt.app\n this.path = opt.path\n this.name = opt.name || null\n this.store = opt.store || null\n this.scrolls = opt.scrolls || createScroll(opt)\n function createScroll (opt) {\n if (!opt.store.$scroll) {\n _Vue.set(opt.store, '$scroll', {})\n }\n if (!opt.store.$scroll[opt.name]) {\n _Vue.set(opt.store.$scroll, opt.name, { x: 0, y: 0 })\n }\n\n return opt.store.$scroll[opt.name]\n }\n }\n scrollTo () {\n const { app, scrolls } = this\n if ('scrollTop' in app && app !== window) {\n app.scrollLeft = scrolls.x\n app.scrollTop = scrolls.y\n } else {\n app.scrollTo(scrolls.x, scrolls.y)\n }\n }\n subScroll () {\n const { app } = this\n const newScrolls = {}\n this.subScrolling = event => {\n if (app === window) {\n newScrolls.x = window.pageXOffset\n newScrolls.y = window.pageYOffset\n } else {\n const { scrollTop, scrollLeft, pageXOffset, pageYOffset } = event.target\n newScrolls.x = scrollLeft || pageYOffset || scrollLeft\n newScrolls.y = scrollTop || pageXOffset || scrollTop\n }\n const key = `timer-${this.path}-${this.name}`\n clearTimeout(this[key])\n this[key] = setTimeout(() => {\n Object.assign(this.scrolls, newScrolls)\n delete this[key]\n }, 10)\n }\n app.addEventListener('scroll', this.subScrolling, false)\n }\n}\n\nfunction isSelf (modifiers) {\n return modifiers.window !== true || modifiers.self\n}\n\nfunction isWindow (modifiers) {\n return modifiers.window\n}\n\nexport default {\n inserted (el, { modifiers, value }, vnode) {\n if (typeof value.path !== 'string') return debug.error('path is imperative parameter and is string type')\n if (value.path === 'window') return debug.error('name cannot be the window name')\n if (isSelf(modifiers)) {\n if (typeof value.name !== 'string') return debug.error('name is imperative parameter and is string type')\n el[_self] = new VuetScroll({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window] = new VuetScroll({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n componentUpdated (el, { modifiers, value }, vnode) {\n if (isSelf(modifiers)) {\n el[_self].update({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window].update({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n unbind (el, { modifiers }) {\n if (isSelf(modifiers)) {\n el[_self].destroy()\n delete el[_self]\n }\n if (isWindow(modifiers)) {\n el[_window].destroy()\n delete el[_window]\n }\n }\n}\n","import utils from './utils'\nimport scroll from './directives/scroll'\n\nexport let _Vue = null\n\nexport default function install (Vue) {\n if (install.installed) return\n install.installed = true\n _Vue = Vue\n Object.defineProperty(Vue.prototype, '$vuet', {\n get () { return this.$root._vuet }\n })\n Vue.mixin({\n beforeCreate () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet._init(this)\n }\n },\n destroyed () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet.destroy(this)\n }\n }\n })\n Vue.directive('vuet-scroll', scroll)\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n },\n destroyed () {\n this.$vuet.reset(path, { current: this })\n }\n }\n }\n}\n","export default {\n rule ({ path, name }) {\n return {\n beforeCreate () {\n const { manuals = {} } = this.$vuet._options.modules[path]\n const methods = {}\n Object.keys(manuals).forEach(k => {\n const fn = manuals[k]\n if (typeof fn === 'function') {\n methods[`${k}`] = (...arg) => {\n return fn.apply(methods, [{\n state: this.$vuet.getState(path),\n vm: this,\n vuet: this.$vuet\n }, ...arg])\n }\n }\n })\n methods.reset = (...arg) => {\n return this.$vuet.reset(path, ...arg)\n }\n methods.fetch = (...arg) => {\n return this.$vuet.fetch(path, ...arg)\n }\n if (name) {\n this[name] = methods\n } else if (manuals.name) {\n this[manuals.name] = methods\n } else {\n const arr = path.split(this.$vuet._options.pathJoin)\n const name = `$${arr[arr.length - 1]}`\n const $methods = this[name] = {}\n Object.assign($methods, methods)\n }\n }\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n }\n }\n }\n}\n","import utils from '../utils'\n\nconst name = 'once'\nconst key = `__${name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, key, {})\n Object.keys(vuet.store).forEach(k => {\n utils.set(vuet[key], k, false)\n })\n },\n rule ({ path }) {\n return {\n beforeCreate () {\n if (this.$vuet[key][path] === false) {\n this.$vuet.fetch(path, { current: this }).then(() => {\n this.$vuet[key][path] = true\n })\n }\n }\n }\n }\n}\n","import utils from '../utils'\n\nexport const _name = 'route'\nexport const _key = `__${_name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, _key, {\n watchers: {},\n scrolls: {}\n })\n Object.keys(vuet.store).forEach(path => {\n utils.set(vuet[_key].watchers, path, [])\n utils.set(vuet[_key].scrolls, path, {})\n })\n },\n rule ({ path }) {\n // vuet-scroll\n function resetVuetScroll (vm) {\n const { $scroll } = vm.$vuet.store[path]\n if ($scroll) {\n Object.keys($scroll).forEach(k => {\n $scroll[k].x = 0\n $scroll[k].y = 0\n $scroll[k].count = $scroll[k].count ? ++$scroll[k].count : 0\n })\n }\n }\n\n // route-watch\n function getVuetWatchs (vuet) {\n return vuet[_key].watchers[path]\n }\n function setVuetWatchs (vuet, val) {\n vuet[_key].watchers[path] = val\n }\n function getWatchs (obj = {}, list) {\n if (typeof list === 'string') {\n list = [list]\n }\n const getObjVal = (obj, str) => {\n const arr = str.split('.')\n arr.forEach(k => {\n obj = obj[k]\n })\n return obj\n }\n const arr = []\n list.forEach(val => {\n let value = getObjVal(obj, val)\n if (!isNaN(value)) {\n value = String(value)\n }\n arr.push(JSON.stringify(value))\n })\n return arr\n }\n\n function diffWatch (to, from) {\n for (let i = 0; i < to.length; i++) {\n if (to[i] !== from[i]) {\n return true\n }\n }\n return false\n }\n\n return {\n beforeCreate () {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(this.$route, routeWatch)\n const watch = diffWatch(toWatch, getVuetWatchs(this.$vuet))\n if (watch) {\n this.$vuet.reset(path)\n setVuetWatchs(this.$vuet, toWatch)\n resetVuetScroll(this)\n }\n this.$vuet.fetch(path, { current: this, routeWatch: watch }, false).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n },\n watch: {\n $route: {\n deep: true,\n handler (to, from) {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(to, routeWatch)\n const fromWatch = getWatchs(from, routeWatch)\n const watch = diffWatch(toWatch, fromWatch)\n if (!watch) return false\n this.$vuet.fetch(path, { current: this, routeWatch: watch }).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n resetVuetScroll(this)\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n }\n }\n }\n }\n }\n}\n","import life from './life'\nimport manual from './manual'\nimport need from './need'\nimport once from './once'\nimport route from './route'\n\nexport default function install (_Vue, Vuet) {\n Vuet\n .rule('life', life)\n .rule('manual', manual)\n .rule('need', need)\n .rule('once', once)\n .rule('route', route)\n}\n","import install, { _Vue } from './install'\nimport utils from './utils'\nimport debug from './debug'\nimport rules from './rules/index'\n\nexport default class Vuet {\n constructor (options) {\n if (!_Vue) {\n debug.error('must call Vue.use(Vuet) before creating a store instance')\n }\n if (typeof Promise === 'undefined') {\n debug.error('Vuet requires a Promise polyfill in this browser')\n }\n if (!utils.isObject(options)) {\n debug.error('Parameter is the object type')\n }\n this.options = options || {}\n this.app = null\n this.store = {}\n this.beforeHooks = [] // Before the request begins\n this.afterHooks = [] // After the request begins\n this.vm = null\n }\n beforeEach (fn) {\n this.beforeHooks.push(fn)\n return this\n }\n afterEach (fn) {\n this.afterHooks.push(fn)\n return this\n }\n _init (app) {\n if (this.app || !app) return\n this.app = app\n this.vm = new _Vue({\n data: {\n store: this.store\n }\n })\n this._options = {\n data: function data () { return {} },\n pathJoin: null,\n ...this.options,\n ...{\n modules: {}\n }\n }\n const keys = ['data', 'fetch', 'routeWatch', 'manuals']\n const { pathJoin } = this._options\n const initModule = (path, modules) => {\n Object.keys(modules).forEach(k => {\n const item = modules[k]\n const _path = [...path, k]\n if (utils.isFunction(item.data)) {\n let newPath = null\n if (pathJoin) {\n newPath = _path.join(pathJoin)\n } else {\n newPath = [_path[0]]\n for (let i = 1; i < _path.length; i++) {\n newPath.push(_path[i].replace(/^(\\w)/, (v) => v.toUpperCase()))\n }\n newPath = newPath.join('')\n }\n this._options.modules[newPath] = item\n this.reset(newPath)\n }\n if (keys.indexOf(k) === -1 && utils.isObject(item)) {\n initModule(_path, item)\n }\n })\n }\n initModule([], this.options.modules)\n callRuleHook('init', this)\n }\n getState (path) {\n return this.store[path] || {}\n }\n setState (path, newState) {\n if (!utils.isObject(newState)) return this\n if (!this.store[path]) {\n _Vue.set(this.store, path, newState)\n return this\n }\n Object.assign(this.store[path], newState)\n return this\n }\n fetch (path, params, setStateBtn) {\n const module = this._options.modules[path]\n if (typeof module.fetch !== 'function') return Promise.resolve(this.getState(path))\n const data = {\n path,\n params: { ...params },\n state: this.getState(path),\n route: this.app.$route || {},\n app: this.app\n }\n const callHook = (hook, ...arg) => {\n for (let i = 0; i < this[hook].length; i++) {\n if (this[hook][i].apply(this, arg)) {\n return false\n }\n }\n }\n if (callHook('beforeHooks', data) === false) return Promise.resolve(data.state)\n return module.fetch.call(this, data)\n .then(res => {\n if (callHook('afterHooks', null, data, res) === false) return data.state\n if (setStateBtn === false) return res\n this.setState(path, res)\n return data.state\n })\n .catch(e => {\n if (callHook('afterHooks', e, data) === false) return Promise.resolve(data.state)\n return Promise.reject(e)\n })\n }\n reset (path) {\n const data = this._options.data.call(this)\n const module = this._options.modules[path]\n if (utils.isFunction(module.data)) {\n Object.assign(data, module.data.call(this, path))\n }\n this.setState(path, data)\n return this\n }\n destroy () {\n this.vm.$destroy()\n callRuleHook('destroy', this)\n }\n}\n\nObject.assign(Vuet, {\n options: {\n rules: {}\n },\n install,\n rule (name, rule) {\n if (this.options.rules[name]) return this\n this.options.rules[name] = rule\n callRuleHook('install', _Vue, Vuet)\n return this\n },\n mapRules (...paths) {\n const opt = utils.getArgMerge.apply(null, arguments)\n const vueRules = []\n const addRule = (ruleName, any) => {\n const rules = Vuet.options.rules[ruleName]\n if (typeof any === 'string') {\n vueRules.push(rules.rule({ path: any }))\n } else {\n vueRules.push(rules.rule(any))\n }\n }\n Object.keys(opt).forEach(ruleName => {\n const any = opt[ruleName]\n if (Array.isArray(any)) {\n return any.forEach(item => {\n addRule(ruleName, item)\n })\n }\n addRule(ruleName, any)\n })\n return {\n mixins: vueRules\n }\n },\n mapModules () {\n const opt = utils.getArgMerge.apply(null, arguments)\n const computed = {}\n Object.keys(opt).forEach(k => {\n const path = opt[k]\n computed[k] = {\n get () {\n return this.$vuet.store[path]\n },\n set (val) {\n this.$vuet.store[path] = val\n }\n }\n })\n return { computed }\n },\n use (plugin, opt) {\n if (utils.isFunction(plugin)) {\n plugin(_Vue, Vuet, opt)\n } else if (utils.isFunction(plugin.install)) {\n plugin.install(_Vue, Vuet, opt)\n }\n return this\n }\n})\n\nfunction callRuleHook (hook, ...arg) {\n const { rules } = Vuet.options\n for (let k in rules) {\n if (utils.isFunction(rules[k][hook])) {\n rules[k][hook].apply(rules[k], arg)\n }\n }\n}\n\nVuet.use(rules)\n","import Vuet from './vuet'\n\nexport const mapRules = Vuet.mapRules.bind(Vuet)\nexport const mapModules = Vuet.mapModules.bind(Vuet)\n\nexport default Vuet\n"],"names":["toString","Object","prototype","typeStrings","utils","opt","args","arguments","isString","length","isObject","obj","key","value","defineProperty","forEach","typeString","type","call","msg","Error","process","env","NODE_ENV","console","warn","_self","_window","VuetScroll","app","path","name","store","scrolls","setOption","scrollTo","subScroll","removeEventListener","subScrolling","createScroll","$scroll","set","x","y","window","scrollLeft","scrollTop","newScrolls","pageXOffset","pageYOffset","event","target","setTimeout","assign","addEventListener","isSelf","modifiers","self","isWindow","el","vnode","debug","error","context","$vuet","update","destroy","_Vue","install","Vue","installed","$root","_vuet","mixin","isUndefined","$options","vuet","_init","directive","scroll","fetch","current","reset","_options","modules","manuals","methods","keys","fn","k","arg","apply","getState","arr","split","pathJoin","$methods","then","_name","_key","watchers","resetVuetScroll","vm","count","getVuetWatchs","setVuetWatchs","val","getWatchs","list","getObjVal","str","isNaN","String","push","JSON","stringify","diffWatch","to","from","i","routeWatch","toWatch","$route","watch","res","setState","fromWatch","Vuet","rule","life","manual","need","once","route","options","Promise","beforeHooks","afterHooks","data","initModule","item","_path","isFunction","newPath","join","replace","v","toUpperCase","indexOf","newState","params","setStateBtn","module","resolve","callHook","hook","state","catch","e","reject","$destroy","rules","paths","getArgMerge","vueRules","addRule","ruleName","any","Array","isArray","computed","plugin","callRuleHook","use","mapRules","bind","mapModules"],"mappings":";;;;;;AAAA,IAAMA,WAAWC,OAAOC,SAAP,CAAiBF,QAAlC;;AAEA,IAAMG,cAAc,CAAC,QAAD,EAAW,UAAX,EAAuB,QAAvB,EAAiC,WAAjC,EAA8C,MAA9C,CAApB;;AAEA,IAAMC,QAAQ;aAAA,yBACG;QACTC,MAAM,EAAV;QACMC,OAAOC,SAAb;QACIH,MAAMI,QAAN,CAAeF,KAAK,CAAL,CAAf,CAAJ,EAA6B;UACvBA,KAAK,CAAL,CAAJ,IAAeA,KAAKG,MAAL,GAAc,CAAd,GAAkBH,KAAK,CAAL,CAAlB,G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,EAAqB4D,MAArB,EAA2B1H,GAA3B;;WAEK,IAAP;;CAzDJ;;AA6DA,SAASuK,YAAT,CAAuBjB,IAAvB,EAAqC;MAC3BM,KAD2B,GACjBlC,OAAKO,OADY,CAC3B2B,KAD2B;;qCAALvE,GAAK;OAAA;;;OAE9B,IAAID,CAAT,IAAcwE,KAAd,EAAqB;QACf7J,MAAM0I,UAAN,CAAiBmB,MAAMxE,CAAN,EAASkE,IAAT,CAAjB,CAAJ,EAAsC;YAC9BlE,CAAN,EAASkE,IAAT,EAAehE,KAAf,CAAqBsE,MAAMxE,CAAN,CAArB,EAA+BC,GAA/B;;;;;AAKNqC,OAAK8C,GAAL,CAASZ,SAAT;;ACxMO,IAAMa,WAAW/C,OAAK+C,QAAL,CAAcC,IAAd,CAAmBhD,MAAnB,CAAjB;AACP,AAAO,IAAMiD,aAAajD,OAAKiD,UAAL,CAAgBD,IAAhB,CAAqBhD,MAArB,CAAnB,CAEP;;;;;;;;"} \ No newline at end of file diff --git a/dist/vuet.min.js b/dist/vuet.min.js index 0b7139f..08aad75 100644 --- a/dist/vuet.min.js +++ b/dist/vuet.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.Vuet=t.Vuet||{})}(this,function(t){"use strict";function e(t){return!0!==t.window||t.self}function n(t){return t.window}function r(t){r.installed||(r.installed=!0,g=t,Object.defineProperty(t.prototype,"$vuet",{get:function(){return this.$root._vuet}}),t.mixin({beforeCreate:function(){a.isUndefined(this.$options.vuet)||(this._vuet=this.$options.vuet,this._vuet._init(this))},destroyed:function(){a.isUndefined(this.$options.vuet)||(this._vuet=this.$options.vuet,this._vuet.destroy(this))}}),t.directive("vuet-scroll",m))}function o(t,e){e.rule("life",b).rule("manual",$).rule("need",w).rule("once",O).rule("route",k)}function i(t){for(var e=S.options.rules,n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?e[1]:e[0]:e[0]&&a.isObject(e[0])&&(t=e[0]),t},set:function(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!1})}};u.forEach(function(t){var e="[object "+t+"]";a["is"+t]=function(t){return s.call(t)===e}});var l={error:function(t){throw new Error("[vuet] "+t)},warn:function(t){}},c=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},f=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];"string"==typeof e&&(e=[e]);var n=function(t,e){return e.split(".").forEach(function(e){t=t[e]}),t},r=[];return e.forEach(function(e){var o=n(t,e);isNaN(o)||(o=String(o)),r.push(JSON.stringify(o))}),r}function i(t,e){for(var n=0;n1?e-1:0),o=1;o1?n-1:0),o=1;o1?e[1]:e[0]:e[0]&&a.isObject(e[0])&&(t=e[0]),t},set:function(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!1})}};u.forEach(function(t){var e="[object "+t+"]";a["is"+t]=function(t){return s.call(t)===e}});var l={error:function(t){throw new Error("[vuet] "+t)},warn:function(t){}},c=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},f=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];"string"==typeof e&&(e=[e]);var n=function(t,e){return e.split(".").forEach(function(e){t=t[e]}),t},r=[];return e.forEach(function(e){var o=n(t,e);isNaN(o)||(o=String(o)),r.push(JSON.stringify(o))}),r}function i(t,e){for(var n=0;n1?e-1:0),o=1;o {\n if (app === window) {\n newScrolls.x = window.pageXOffset\n newScrolls.y = window.pageYOffset\n } else {\n const { scrollTop, scrollLeft, pageXOffset, pageYOffset } = event.target\n newScrolls.x = scrollLeft || pageYOffset || scrollLeft\n newScrolls.y = scrollTop || pageXOffset || scrollTop\n }\n const key = `timer-${this.path}-${this.name}`\n clearTimeout(this[key])\n this[key] = setTimeout(() => {\n Object.assign(this.scrolls, newScrolls)\n delete this[key]\n }, 30)\n }\n app.addEventListener('scroll', this.subScrolling, false)\n }\n}\n\nfunction isSelf (modifiers) {\n return modifiers.window !== true || modifiers.self\n}\n\nfunction isWindow (modifiers) {\n return modifiers.window\n}\n\nexport default {\n inserted (el, { modifiers, value }, vnode) {\n if (typeof value.path !== 'string') return debug.error('path is imperative parameter and is string type')\n if (value.path === 'window') return debug.error('name cannot be the window name')\n if (isSelf(modifiers)) {\n if (typeof value.name !== 'string') return debug.error('name is imperative parameter and is string type')\n el[_self] = new VuetScroll({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window] = new VuetScroll({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n componentUpdated (el, { modifiers, value }, vnode) {\n if (isSelf(modifiers)) {\n el[_self].update({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window].update({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n unbind (el, { modifiers }) {\n if (isSelf(modifiers)) {\n el[_self].destroy()\n delete el[_self]\n }\n if (isWindow(modifiers)) {\n el[_window].destroy()\n delete el[_window]\n }\n }\n}\n","import utils from './utils'\nimport scroll from './directives/scroll'\n\nexport let _Vue = null\n\nexport default function install (Vue) {\n if (install.installed) return\n install.installed = true\n _Vue = Vue\n Object.defineProperty(Vue.prototype, '$vuet', {\n get () { return this.$root._vuet }\n })\n Vue.mixin({\n beforeCreate () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet._init(this)\n }\n },\n destroyed () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet.destroy(this)\n }\n }\n })\n Vue.directive('vuet-scroll', scroll)\n}\n","import life from './life'\nimport manual from './manual'\nimport need from './need'\nimport once from './once'\nimport route from './route'\n\nexport default function install (_Vue, Vuet) {\n Vuet\n .rule('life', life)\n .rule('manual', manual)\n .rule('need', need)\n .rule('once', once)\n .rule('route', route)\n}\n","import install, { _Vue } from './install'\nimport utils from './utils'\nimport debug from './debug'\nimport rules from './rules/index'\n\nexport default class Vuet {\n constructor (options) {\n if (!_Vue) {\n debug.error('must call Vue.use(Vuet) before creating a store instance')\n }\n if (typeof Promise === 'undefined') {\n debug.error('Vuet requires a Promise polyfill in this browser')\n }\n if (!utils.isObject(options)) {\n debug.error('Parameter is the object type')\n }\n this.options = options || {}\n this.app = null\n this.store = {}\n this.beforeHooks = [] // Before the request begins\n this.afterHooks = [] // After the request begins\n this.vm = null\n }\n beforeEach (fn) {\n this.beforeHooks.push(fn)\n return this\n }\n afterEach (fn) {\n this.afterHooks.push(fn)\n return this\n }\n _init (app) {\n if (this.app || !app) return\n this.app = app\n this.vm = new _Vue({\n data: {\n store: this.store\n }\n })\n this._options = {\n data: function data () { return {} },\n pathJoin: null,\n ...this.options,\n ...{\n modules: {}\n }\n }\n const keys = ['data', 'fetch', 'routeWatch', 'manuals']\n const { pathJoin } = this._options\n const initModule = (path, modules) => {\n Object.keys(modules).forEach(k => {\n const item = modules[k]\n const _path = [...path, k]\n if (utils.isFunction(item.data)) {\n let newPath = null\n if (pathJoin) {\n newPath = _path.join(pathJoin)\n } else {\n newPath = [_path[0]]\n for (let i = 1; i < _path.length; i++) {\n newPath.push(_path[i].replace(/^(\\w)/, (v) => v.toUpperCase()))\n }\n newPath = newPath.join('')\n }\n this._options.modules[newPath] = item\n this.reset(newPath)\n }\n if (keys.indexOf(k) === -1 && utils.isObject(item)) {\n initModule(_path, item)\n }\n })\n }\n initModule([], this.options.modules)\n callRuleHook('init', this)\n }\n getState (path) {\n return this.store[path] || {}\n }\n setState (path, newState) {\n if (!utils.isObject(newState)) return this\n if (!this.store[path]) {\n _Vue.set(this.store, path, newState)\n return this\n }\n Object.assign(this.store[path], newState)\n return this\n }\n fetch (path, params, setStateBtn) {\n const module = this._options.modules[path]\n if (typeof module.fetch !== 'function') return Promise.resolve(this.getState(path))\n const data = {\n path,\n params: { ...params },\n state: this.getState(path),\n route: this.app.$route || {},\n app: this.app\n }\n const callHook = (hook, ...arg) => {\n for (let i = 0; i < this[hook].length; i++) {\n if (this[hook][i].apply(this, arg)) {\n return false\n }\n }\n }\n if (callHook('beforeHooks', data) === false) return Promise.resolve(data.state)\n return module.fetch.call(this, data)\n .then(res => {\n if (callHook('afterHooks', null, data, res) === false) return data.state\n if (setStateBtn === false) return res\n this.setState(path, res)\n return data.state\n })\n .catch(e => {\n if (callHook('afterHooks', e, data) === false) return Promise.resolve(data.state)\n return Promise.reject(e)\n })\n }\n reset (path) {\n const data = this._options.data.call(this)\n const module = this._options.modules[path]\n if (utils.isFunction(module.data)) {\n Object.assign(data, module.data.call(this, path))\n }\n this.setState(path, data)\n return this\n }\n destroy () {\n this.vm.$destroy()\n callRuleHook('destroy', this)\n }\n}\n\nObject.assign(Vuet, {\n options: {\n rules: {}\n },\n install,\n rule (name, rule) {\n if (this.options.rules[name]) return this\n this.options.rules[name] = rule\n callRuleHook('install', _Vue, Vuet)\n return this\n },\n mapRules (...paths) {\n const opt = utils.getArgMerge.apply(null, arguments)\n const vueRules = []\n const addRule = (ruleName, any) => {\n const rules = Vuet.options.rules[ruleName]\n if (typeof any === 'string') {\n vueRules.push(rules.rule({ path: any }))\n } else {\n vueRules.push(rules.rule(any))\n }\n }\n Object.keys(opt).forEach(ruleName => {\n const any = opt[ruleName]\n if (Array.isArray(any)) {\n return any.forEach(item => {\n addRule(ruleName, item)\n })\n }\n addRule(ruleName, any)\n })\n return {\n mixins: vueRules\n }\n },\n mapModules () {\n const opt = utils.getArgMerge.apply(null, arguments)\n const computed = {}\n Object.keys(opt).forEach(k => {\n const path = opt[k]\n computed[k] = {\n get () {\n return this.$vuet.store[path]\n },\n set (val) {\n this.$vuet.store[path] = val\n }\n }\n })\n return { computed }\n },\n use (plugin, opt) {\n if (utils.isFunction(plugin)) {\n plugin(_Vue, Vuet, opt)\n } else if (utils.isFunction(plugin.install)) {\n plugin.install(_Vue, Vuet, opt)\n }\n return this\n }\n})\n\nfunction callRuleHook (hook, ...arg) {\n const { rules } = Vuet.options\n for (let k in rules) {\n if (utils.isFunction(rules[k][hook])) {\n rules[k][hook].apply(rules[k], arg)\n }\n }\n}\n\nVuet.use(rules)\n","const toString = Object.prototype.toString\n// Cached type string\nconst typeStrings = ['Object', 'Function', 'String', 'Undefined', 'Null']\n\nconst utils = {\n getArgMerge () {\n let opt = {}\n const args = arguments\n if (utils.isString(args[0])) {\n opt[args[0]] = args.length > 1 ? args[1] : args[0]\n } else if (args[0] && utils.isObject(args[0])) {\n opt = args[0]\n }\n return opt\n },\n set (obj, key, value) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: false,\n writable: true,\n configurable: false\n })\n }\n}\n\n// Add isXXX function\ntypeStrings.forEach(type => {\n const typeString = `[object ${type}]`\n utils[`is${type}`] = obj => {\n return toString.call(obj) === typeString\n }\n})\n\nexport default utils\n","export default {\n error (msg) {\n throw new Error(`[vuet] ${msg}`)\n },\n warn (msg) {\n if (process.env.NODE_ENV !== 'production') {\n typeof console !== 'undefined' && console.warn(`[vuet] ${msg}`)\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n },\n destroyed () {\n this.$vuet.reset(path, { current: this })\n }\n }\n }\n}\n","export default {\n rule ({ path, name }) {\n return {\n beforeCreate () {\n const { manuals = {} } = this.$vuet._options.modules[path]\n const methods = {}\n Object.keys(manuals).forEach(k => {\n const fn = manuals[k]\n if (typeof fn === 'function') {\n methods[`${k}`] = (...arg) => {\n return fn.apply(methods, [{\n state: this.$vuet.getState(path),\n vm: this,\n vuet: this.$vuet\n }, ...arg])\n }\n }\n })\n methods.reset = (...arg) => {\n return this.$vuet.reset(path, ...arg)\n }\n methods.fetch = (...arg) => {\n return this.$vuet.fetch(path, ...arg)\n }\n if (name) {\n this[name] = methods\n } else if (manuals.name) {\n this[manuals.name] = methods\n } else {\n const arr = path.split(this.$vuet._options.pathJoin)\n const name = `$${arr[arr.length - 1]}`\n const $methods = this[name] = {}\n Object.assign($methods, methods)\n }\n }\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n }\n }\n }\n}\n","import utils from '../utils'\n\nconst name = 'once'\nconst key = `__${name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, key, {})\n Object.keys(vuet.store).forEach(k => {\n utils.set(vuet[key], k, false)\n })\n },\n rule ({ path }) {\n return {\n beforeCreate () {\n if (this.$vuet[key][path] === false) {\n this.$vuet.fetch(path, { current: this }).then(() => {\n this.$vuet[key][path] = true\n })\n }\n }\n }\n }\n}\n","import utils from '../utils'\n\nexport const _name = 'route'\nexport const _key = `__${_name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, _key, {\n watchers: {},\n scrolls: {}\n })\n Object.keys(vuet.store).forEach(path => {\n utils.set(vuet[_key].watchers, path, [])\n utils.set(vuet[_key].scrolls, path, {})\n })\n },\n rule ({ path }) {\n // vuet-scroll\n function resetVuetScroll (vm) {\n const { $scroll } = vm.$vuet.store[path]\n if ($scroll) {\n Object.keys($scroll).forEach(k => {\n $scroll[k].x = 0\n $scroll[k].y = 0\n $scroll[k].count = $scroll[k].count ? ++$scroll[k].count : 0\n })\n }\n }\n\n // route-watch\n function getVuetWatchs (vuet) {\n return vuet[_key].watchers[path]\n }\n function setVuetWatchs (vuet, val) {\n vuet[_key].watchers[path] = val\n }\n function getWatchs (obj = {}, list) {\n if (typeof list === 'string') {\n list = [list]\n }\n const getObjVal = (obj, str) => {\n const arr = str.split('.')\n arr.forEach(k => {\n obj = obj[k]\n })\n return obj\n }\n const arr = []\n list.forEach(val => {\n let value = getObjVal(obj, val)\n if (!isNaN(value)) {\n value = String(value)\n }\n arr.push(JSON.stringify(value))\n })\n return arr\n }\n\n function diffWatch (to, from) {\n for (let i = 0; i < to.length; i++) {\n if (to[i] !== from[i]) {\n return true\n }\n }\n return false\n }\n\n return {\n beforeCreate () {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(this.$route, routeWatch)\n const watch = diffWatch(toWatch, getVuetWatchs(this.$vuet))\n if (watch) {\n this.$vuet.reset(path)\n setVuetWatchs(this.$vuet, toWatch)\n resetVuetScroll(this)\n }\n this.$vuet.fetch(path, { current: this, routeWatch: watch }, false).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n },\n watch: {\n $route: {\n deep: true,\n handler (to, from) {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(to, routeWatch)\n const fromWatch = getWatchs(from, routeWatch)\n const watch = diffWatch(toWatch, fromWatch)\n if (!watch) return false\n this.$vuet.fetch(path, { current: this, routeWatch: watch }).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n resetVuetScroll(this)\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n }\n }\n }\n }\n }\n}\n","import Vuet from './vuet'\n\nexport const mapRules = Vuet.mapRules.bind(Vuet)\nexport const mapModules = Vuet.mapModules.bind(Vuet)\n\nexport default Vuet\n"],"names":["isSelf","modifiers","window","self","isWindow","install","Vue","installed","defineProperty","prototype","this","$root","_vuet","mixin","utils","isUndefined","$options","vuet","_init","destroy","directive","scroll","_Vue","Vuet","rule","life","manual","need","once","route","callRuleHook","hook","rules","options","arg","k","isFunction","apply","toString","Object","typeStrings","opt","args","arguments","isString","length","isObject","obj","key","value","forEach","typeString","type","call","msg","Error","_self","_window","VuetScroll","app","path","name","store","scrolls","setOption","scrollTo","subScroll","removeEventListener","subScrolling","$scroll","set","x","y","scrollLeft","scrollTop","newScrolls","pageXOffset","pageYOffset","event","target","_this","setTimeout","assign","addEventListener","el","vnode","debug","error","context","$vuet","update","fetch","current","reset","_options","modules","manuals","methods","keys","fn","getState","arr","split","pathJoin","$methods","then","_key","watchers","resetVuetScroll","vm","count","getVuetWatchs","setVuetWatchs","val","getWatchs","list","getObjVal","str","isNaN","String","push","JSON","stringify","diffWatch","to","from","i","routeWatch","toWatch","$route","watch","res","setState","fromWatch","_this2","Promise","beforeHooks","afterHooks","initModule","item","_path","data","newPath","join","replace","v","toUpperCase","indexOf","newState","params","setStateBtn","module","resolve","callHook","state","catch","e","reject","$destroy","paths","getArgMerge","vueRules","addRule","ruleName","any","Array","isArray","computed","plugin","use","mapRules","bind","mapModules"],"mappings":"8LAyEA,SAASA,GAAQC,UACa,IAArBA,EAAUC,QAAmBD,EAAUE,KAGhD,QAASC,GAAUH,SACVA,GAAUC,OCzEnB,QAAwBG,GAASC,GAC3BD,EAAQE,cACJA,WAAY,IACbD,SACAE,eAAeF,EAAIG,UAAW,8BACnBC,MAAKC,MAAMC,WAEzBC,+BAEKC,EAAMC,YAAYL,KAAKM,SAASC,aAC9BL,MAAQF,KAAKM,SAASC,UACtBL,MAAMM,MAAMR,6BAIdI,EAAMC,YAAYL,KAAKM,SAASC,aAC9BL,MAAQF,KAAKM,SAASC,UACtBL,MAAMO,QAAQT,YAIrBU,UAAU,cAAeC,ICpBhB,QAAShB,GAASiB,EAAMC,KAElCC,KAAK,OAAQC,GACbD,KAAK,SAAUE,GACfF,KAAK,OAAQG,GACbH,KAAK,OAAQI,GACbJ,KAAK,QAASK,GCqLnB,QAASC,GAAcC,UACbC,GAAUT,EAAKU,QAAfD,yBADsBE,uDAEzB,GAAIC,KAAKH,GACRlB,EAAMsB,WAAWJ,EAAMG,GAAGJ,OACtBI,GAAGJ,GAAMM,MAAML,EAAMG,GAAID,GCrMrC,GAAMI,GAAWC,OAAO9B,UAAU6B,SAE5BE,GAAe,SAAU,WAAY,SAAU,YAAa,QAE5D1B,6BAEE2B,MAC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EAAUC,MACnBpI,GAAQT,EAAKU,QAAQD,MAAMmI,EACd,iBAARC,KACA5C,KAAKxF,EAAMR,MAAOoC,KAAMwG,OAExB5C,KAAKxF,EAAMR,KAAK4I,mBAGtBlE,KAAKzD,GAAKS,QAAQ,eACjBkH,GAAM3H,EAAI0H,MACZE,MAAMC,QAAQF,SACTA,GAAIlH,QAAQ,cACTiH,EAAUxB,OAGdwB,EAAUC,aAGVH,6BAIJxH,GAAM3B,EAAMkJ,YAAY3H,MAAM,KAAMM,WACpC4H,mBACCrE,KAAKzD,GAAKS,QAAQ,eACjBU,GAAOnB,EAAIN,KACRA,yBAEEzB,MAAK+E,MAAM3B,MAAMF,iBAErBqD,QACExB,MAAM3B,MAAMF,GAAQqD,OAItBsD,0BAENC,EAAQ/H,SACP3B,GAAMsB,WAAWoI,KACZlJ,EAAMC,EAAMkB,GACV3B,EAAMsB,WAAWoI,EAAOnK,YAC1BA,QAAQiB,EAAMC,EAAMkB,GAEtB/B,QAaXa,EAAKkJ,IAAIzI,EQxMF,IAAM0I,GAAWnJ,EAAKmJ,SAASC,KAAKpJ,GAC9BqJ,EAAarJ,EAAKqJ,WAAWD,KAAKpJ"} \ No newline at end of file +{"version":3,"file":"vuet.min.js","sources":["../src/directives/scroll.js","../src/install.js","../src/rules/index.js","../src/vuet.js","../src/utils.js","../src/debug.js","../src/rules/life.js","../src/rules/manual.js","../src/rules/need.js","../src/rules/once.js","../src/rules/route.js","../src/index.js"],"sourcesContent":["import { _Vue } from '../install'\nimport debug from '../debug'\n\nconst _self = '__vuetScrollSelf__'\nconst _window = '__vuetScrollWindow__'\n\nclass VuetScroll {\n constructor (opt) {\n this.app = null\n this.path = null\n this.name = null\n this.store = null\n this.scrolls = null\n this.setOption(opt)\n this.scrollTo()\n this.subScroll()\n }\n update (opt) {\n this.setOption(opt)\n this.scrollTo()\n }\n destroy () {\n this.app.removeEventListener('scroll', this.subScrolling, false)\n }\n setOption (opt) {\n this.app = opt.app\n this.path = opt.path\n this.name = opt.name || null\n this.store = opt.store || null\n this.scrolls = opt.scrolls || createScroll(opt)\n function createScroll (opt) {\n if (!opt.store.$scroll) {\n _Vue.set(opt.store, '$scroll', {})\n }\n if (!opt.store.$scroll[opt.name]) {\n _Vue.set(opt.store.$scroll, opt.name, { x: 0, y: 0 })\n }\n\n return opt.store.$scroll[opt.name]\n }\n }\n scrollTo () {\n const { app, scrolls } = this\n if ('scrollTop' in app && app !== window) {\n app.scrollLeft = scrolls.x\n app.scrollTop = scrolls.y\n } else {\n app.scrollTo(scrolls.x, scrolls.y)\n }\n }\n subScroll () {\n const { app } = this\n const newScrolls = {}\n this.subScrolling = event => {\n if (app === window) {\n newScrolls.x = window.pageXOffset\n newScrolls.y = window.pageYOffset\n } else {\n const { scrollTop, scrollLeft, pageXOffset, pageYOffset } = event.target\n newScrolls.x = scrollLeft || pageYOffset || scrollLeft\n newScrolls.y = scrollTop || pageXOffset || scrollTop\n }\n const key = `timer-${this.path}-${this.name}`\n clearTimeout(this[key])\n this[key] = setTimeout(() => {\n Object.assign(this.scrolls, newScrolls)\n delete this[key]\n }, 10)\n }\n app.addEventListener('scroll', this.subScrolling, false)\n }\n}\n\nfunction isSelf (modifiers) {\n return modifiers.window !== true || modifiers.self\n}\n\nfunction isWindow (modifiers) {\n return modifiers.window\n}\n\nexport default {\n inserted (el, { modifiers, value }, vnode) {\n if (typeof value.path !== 'string') return debug.error('path is imperative parameter and is string type')\n if (value.path === 'window') return debug.error('name cannot be the window name')\n if (isSelf(modifiers)) {\n if (typeof value.name !== 'string') return debug.error('name is imperative parameter and is string type')\n el[_self] = new VuetScroll({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window] = new VuetScroll({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n componentUpdated (el, { modifiers, value }, vnode) {\n if (isSelf(modifiers)) {\n el[_self].update({\n app: el,\n path: value.path,\n name: value.name,\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.self\n })\n }\n if (isWindow(modifiers)) {\n el[_window].update({\n app: window,\n path: value.path,\n name: 'window',\n store: vnode.context.$vuet.store[value.path],\n scrolls: value.window || null\n })\n }\n },\n unbind (el, { modifiers }) {\n if (isSelf(modifiers)) {\n el[_self].destroy()\n delete el[_self]\n }\n if (isWindow(modifiers)) {\n el[_window].destroy()\n delete el[_window]\n }\n }\n}\n","import utils from './utils'\nimport scroll from './directives/scroll'\n\nexport let _Vue = null\n\nexport default function install (Vue) {\n if (install.installed) return\n install.installed = true\n _Vue = Vue\n Object.defineProperty(Vue.prototype, '$vuet', {\n get () { return this.$root._vuet }\n })\n Vue.mixin({\n beforeCreate () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet._init(this)\n }\n },\n destroyed () {\n if (!utils.isUndefined(this.$options.vuet)) {\n this._vuet = this.$options.vuet\n this._vuet.destroy(this)\n }\n }\n })\n Vue.directive('vuet-scroll', scroll)\n}\n","import life from './life'\nimport manual from './manual'\nimport need from './need'\nimport once from './once'\nimport route from './route'\n\nexport default function install (_Vue, Vuet) {\n Vuet\n .rule('life', life)\n .rule('manual', manual)\n .rule('need', need)\n .rule('once', once)\n .rule('route', route)\n}\n","import install, { _Vue } from './install'\nimport utils from './utils'\nimport debug from './debug'\nimport rules from './rules/index'\n\nexport default class Vuet {\n constructor (options) {\n if (!_Vue) {\n debug.error('must call Vue.use(Vuet) before creating a store instance')\n }\n if (typeof Promise === 'undefined') {\n debug.error('Vuet requires a Promise polyfill in this browser')\n }\n if (!utils.isObject(options)) {\n debug.error('Parameter is the object type')\n }\n this.options = options || {}\n this.app = null\n this.store = {}\n this.beforeHooks = [] // Before the request begins\n this.afterHooks = [] // After the request begins\n this.vm = null\n }\n beforeEach (fn) {\n this.beforeHooks.push(fn)\n return this\n }\n afterEach (fn) {\n this.afterHooks.push(fn)\n return this\n }\n _init (app) {\n if (this.app || !app) return\n this.app = app\n this.vm = new _Vue({\n data: {\n store: this.store\n }\n })\n this._options = {\n data: function data () { return {} },\n pathJoin: null,\n ...this.options,\n ...{\n modules: {}\n }\n }\n const keys = ['data', 'fetch', 'routeWatch', 'manuals']\n const { pathJoin } = this._options\n const initModule = (path, modules) => {\n Object.keys(modules).forEach(k => {\n const item = modules[k]\n const _path = [...path, k]\n if (utils.isFunction(item.data)) {\n let newPath = null\n if (pathJoin) {\n newPath = _path.join(pathJoin)\n } else {\n newPath = [_path[0]]\n for (let i = 1; i < _path.length; i++) {\n newPath.push(_path[i].replace(/^(\\w)/, (v) => v.toUpperCase()))\n }\n newPath = newPath.join('')\n }\n this._options.modules[newPath] = item\n this.reset(newPath)\n }\n if (keys.indexOf(k) === -1 && utils.isObject(item)) {\n initModule(_path, item)\n }\n })\n }\n initModule([], this.options.modules)\n callRuleHook('init', this)\n }\n getState (path) {\n return this.store[path] || {}\n }\n setState (path, newState) {\n if (!utils.isObject(newState)) return this\n if (!this.store[path]) {\n _Vue.set(this.store, path, newState)\n return this\n }\n Object.assign(this.store[path], newState)\n return this\n }\n fetch (path, params, setStateBtn) {\n const module = this._options.modules[path]\n if (typeof module.fetch !== 'function') return Promise.resolve(this.getState(path))\n const data = {\n path,\n params: { ...params },\n state: this.getState(path),\n route: this.app.$route || {},\n app: this.app\n }\n const callHook = (hook, ...arg) => {\n for (let i = 0; i < this[hook].length; i++) {\n if (this[hook][i].apply(this, arg)) {\n return false\n }\n }\n }\n if (callHook('beforeHooks', data) === false) return Promise.resolve(data.state)\n return module.fetch.call(this, data)\n .then(res => {\n if (callHook('afterHooks', null, data, res) === false) return data.state\n if (setStateBtn === false) return res\n this.setState(path, res)\n return data.state\n })\n .catch(e => {\n if (callHook('afterHooks', e, data) === false) return Promise.resolve(data.state)\n return Promise.reject(e)\n })\n }\n reset (path) {\n const data = this._options.data.call(this)\n const module = this._options.modules[path]\n if (utils.isFunction(module.data)) {\n Object.assign(data, module.data.call(this, path))\n }\n this.setState(path, data)\n return this\n }\n destroy () {\n this.vm.$destroy()\n callRuleHook('destroy', this)\n }\n}\n\nObject.assign(Vuet, {\n options: {\n rules: {}\n },\n install,\n rule (name, rule) {\n if (this.options.rules[name]) return this\n this.options.rules[name] = rule\n callRuleHook('install', _Vue, Vuet)\n return this\n },\n mapRules (...paths) {\n const opt = utils.getArgMerge.apply(null, arguments)\n const vueRules = []\n const addRule = (ruleName, any) => {\n const rules = Vuet.options.rules[ruleName]\n if (typeof any === 'string') {\n vueRules.push(rules.rule({ path: any }))\n } else {\n vueRules.push(rules.rule(any))\n }\n }\n Object.keys(opt).forEach(ruleName => {\n const any = opt[ruleName]\n if (Array.isArray(any)) {\n return any.forEach(item => {\n addRule(ruleName, item)\n })\n }\n addRule(ruleName, any)\n })\n return {\n mixins: vueRules\n }\n },\n mapModules () {\n const opt = utils.getArgMerge.apply(null, arguments)\n const computed = {}\n Object.keys(opt).forEach(k => {\n const path = opt[k]\n computed[k] = {\n get () {\n return this.$vuet.store[path]\n },\n set (val) {\n this.$vuet.store[path] = val\n }\n }\n })\n return { computed }\n },\n use (plugin, opt) {\n if (utils.isFunction(plugin)) {\n plugin(_Vue, Vuet, opt)\n } else if (utils.isFunction(plugin.install)) {\n plugin.install(_Vue, Vuet, opt)\n }\n return this\n }\n})\n\nfunction callRuleHook (hook, ...arg) {\n const { rules } = Vuet.options\n for (let k in rules) {\n if (utils.isFunction(rules[k][hook])) {\n rules[k][hook].apply(rules[k], arg)\n }\n }\n}\n\nVuet.use(rules)\n","const toString = Object.prototype.toString\n// Cached type string\nconst typeStrings = ['Object', 'Function', 'String', 'Undefined', 'Null']\n\nconst utils = {\n getArgMerge () {\n let opt = {}\n const args = arguments\n if (utils.isString(args[0])) {\n opt[args[0]] = args.length > 1 ? args[1] : args[0]\n } else if (args[0] && utils.isObject(args[0])) {\n opt = args[0]\n }\n return opt\n },\n set (obj, key, value) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: false,\n writable: true,\n configurable: false\n })\n }\n}\n\n// Add isXXX function\ntypeStrings.forEach(type => {\n const typeString = `[object ${type}]`\n utils[`is${type}`] = obj => {\n return toString.call(obj) === typeString\n }\n})\n\nexport default utils\n","export default {\n error (msg) {\n throw new Error(`[vuet] ${msg}`)\n },\n warn (msg) {\n if (process.env.NODE_ENV !== 'production') {\n typeof console !== 'undefined' && console.warn(`[vuet] ${msg}`)\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n },\n destroyed () {\n this.$vuet.reset(path, { current: this })\n }\n }\n }\n}\n","export default {\n rule ({ path, name }) {\n return {\n beforeCreate () {\n const { manuals = {} } = this.$vuet._options.modules[path]\n const methods = {}\n Object.keys(manuals).forEach(k => {\n const fn = manuals[k]\n if (typeof fn === 'function') {\n methods[`${k}`] = (...arg) => {\n return fn.apply(methods, [{\n state: this.$vuet.getState(path),\n vm: this,\n vuet: this.$vuet\n }, ...arg])\n }\n }\n })\n methods.reset = (...arg) => {\n return this.$vuet.reset(path, ...arg)\n }\n methods.fetch = (...arg) => {\n return this.$vuet.fetch(path, ...arg)\n }\n if (name) {\n this[name] = methods\n } else if (manuals.name) {\n this[manuals.name] = methods\n } else {\n const arr = path.split(this.$vuet._options.pathJoin)\n const name = `$${arr[arr.length - 1]}`\n const $methods = this[name] = {}\n Object.assign($methods, methods)\n }\n }\n }\n }\n}\n","export default {\n rule ({ path }) {\n return {\n beforeCreate () {\n this.$vuet.fetch(path, { current: this })\n }\n }\n }\n}\n","import utils from '../utils'\n\nconst name = 'once'\nconst key = `__${name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, key, {})\n Object.keys(vuet.store).forEach(k => {\n utils.set(vuet[key], k, false)\n })\n },\n rule ({ path }) {\n return {\n beforeCreate () {\n if (this.$vuet[key][path] === false) {\n this.$vuet.fetch(path, { current: this }).then(() => {\n this.$vuet[key][path] = true\n })\n }\n }\n }\n }\n}\n","import utils from '../utils'\n\nexport const _name = 'route'\nexport const _key = `__${_name}__`\n\nexport default {\n init (vuet) {\n utils.set(vuet, _key, {\n watchers: {},\n scrolls: {}\n })\n Object.keys(vuet.store).forEach(path => {\n utils.set(vuet[_key].watchers, path, [])\n utils.set(vuet[_key].scrolls, path, {})\n })\n },\n rule ({ path }) {\n // vuet-scroll\n function resetVuetScroll (vm) {\n const { $scroll } = vm.$vuet.store[path]\n if ($scroll) {\n Object.keys($scroll).forEach(k => {\n $scroll[k].x = 0\n $scroll[k].y = 0\n $scroll[k].count = $scroll[k].count ? ++$scroll[k].count : 0\n })\n }\n }\n\n // route-watch\n function getVuetWatchs (vuet) {\n return vuet[_key].watchers[path]\n }\n function setVuetWatchs (vuet, val) {\n vuet[_key].watchers[path] = val\n }\n function getWatchs (obj = {}, list) {\n if (typeof list === 'string') {\n list = [list]\n }\n const getObjVal = (obj, str) => {\n const arr = str.split('.')\n arr.forEach(k => {\n obj = obj[k]\n })\n return obj\n }\n const arr = []\n list.forEach(val => {\n let value = getObjVal(obj, val)\n if (!isNaN(value)) {\n value = String(value)\n }\n arr.push(JSON.stringify(value))\n })\n return arr\n }\n\n function diffWatch (to, from) {\n for (let i = 0; i < to.length; i++) {\n if (to[i] !== from[i]) {\n return true\n }\n }\n return false\n }\n\n return {\n beforeCreate () {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(this.$route, routeWatch)\n const watch = diffWatch(toWatch, getVuetWatchs(this.$vuet))\n if (watch) {\n this.$vuet.reset(path)\n setVuetWatchs(this.$vuet, toWatch)\n resetVuetScroll(this)\n }\n this.$vuet.fetch(path, { current: this, routeWatch: watch }, false).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n },\n watch: {\n $route: {\n deep: true,\n handler (to, from) {\n const { routeWatch = 'fullPath' } = this.$vuet._options.modules[path]\n const toWatch = getWatchs(to, routeWatch)\n const fromWatch = getWatchs(from, routeWatch)\n const watch = diffWatch(toWatch, fromWatch)\n if (!watch) return false\n this.$vuet.fetch(path, { current: this, routeWatch: watch }).then((res) => {\n if (diffWatch(toWatch, getWatchs(this.$route, routeWatch))) return\n resetVuetScroll(this)\n this.$vuet.setState(path, res)\n setVuetWatchs(this.$vuet, toWatch)\n })\n }\n }\n }\n }\n }\n}\n","import Vuet from './vuet'\n\nexport const mapRules = Vuet.mapRules.bind(Vuet)\nexport const mapModules = Vuet.mapModules.bind(Vuet)\n\nexport default Vuet\n"],"names":["isSelf","modifiers","window","self","isWindow","install","Vue","installed","defineProperty","prototype","this","$root","_vuet","mixin","utils","isUndefined","$options","vuet","_init","destroy","directive","scroll","_Vue","Vuet","rule","life","manual","need","once","route","callRuleHook","hook","rules","options","arg","k","isFunction","apply","toString","Object","typeStrings","opt","args","arguments","isString","length","isObject","obj","key","value","forEach","typeString","type","call","msg","Error","_self","_window","VuetScroll","app","path","name","store","scrolls","setOption","scrollTo","subScroll","removeEventListener","subScrolling","$scroll","set","x","y","scrollLeft","scrollTop","newScrolls","pageXOffset","pageYOffset","event","target","_this","setTimeout","assign","addEventListener","el","vnode","debug","error","context","$vuet","update","fetch","current","reset","_options","modules","manuals","methods","keys","fn","getState","arr","split","pathJoin","$methods","then","_key","watchers","resetVuetScroll","vm","count","getVuetWatchs","setVuetWatchs","val","getWatchs","list","getObjVal","str","isNaN","String","push","JSON","stringify","diffWatch","to","from","i","routeWatch","toWatch","$route","watch","res","setState","fromWatch","_this2","Promise","beforeHooks","afterHooks","initModule","item","_path","data","newPath","join","replace","v","toUpperCase","indexOf","newState","params","setStateBtn","module","resolve","callHook","state","catch","e","reject","$destroy","paths","getArgMerge","vueRules","addRule","ruleName","any","Array","isArray","computed","plugin","use","mapRules","bind","mapModules"],"mappings":"8LAyEA,SAASA,GAAQC,UACa,IAArBA,EAAUC,QAAmBD,EAAUE,KAGhD,QAASC,GAAUH,SACVA,GAAUC,OCzEnB,QAAw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sB,WAAWoI,EAAOnK,YAC1BA,QAAQiB,EAAMC,EAAMkB,GAEtB/B,QAaXa,EAAKkJ,IAAIzI,EQxMF,IAAM0I,GAAWnJ,EAAKmJ,SAASC,KAAKpJ,GAC9BqJ,EAAarJ,EAAKqJ,WAAWD,KAAKpJ"} \ No newline at end of file diff --git a/package.json b/package.json index 376d1fa..e6b60b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuet", - "version": "0.2.1", + "version": "0.2.2", "description": "Vue state management plugin", "main": "dist/vuet.js", "scripts": { diff --git a/src/directives/scroll.js b/src/directives/scroll.js index ad6fdfc..7f5a408 100644 --- a/src/directives/scroll.js +++ b/src/directives/scroll.js @@ -65,7 +65,7 @@ class VuetScroll { this[key] = setTimeout(() => { Object.assign(this.scrolls, newScrolls) delete this[key] - }, 30) + }, 10) } app.addEventListener('scroll', this.subScrolling, false) }