text: (function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/vue-auto-storage/",r(r.s=0)})({0:function(e,t,r){e.exports=r("c31f")},"42b1":function(e,t,r){"use strict";var o=r("a2c1"),n=r.n(o);n.a},"5f72":function(e,t){e.exports=ELEMENT},"8bbf":function(e,t){e.exports=Vue},"9f69":function(e,t,r){
  /*!
    * vue-auto-storage.js v1.8.1
    * (c) 2018 Rocco Mormont
    * @license MIT
    */
  !function(t,r){e.exports=r()}(0,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"")}function o(t,o,n){if("string"==typeof o){for(var a=r(o).split("."),i=a.pop(),s=0,l=a.length;s<l;s++){if("object"!==e(t))return;t=t[a[s]]}t[i]=n}}var n="__AUTO_STORAGE__",a=function(){function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._vm=e,this._unwatchFns=Object.create(null),this._storage=e.__AUTO_STORAGE_OPTIONS__.storage,this._debounce=e.__AUTO_STORAGE_OPTIONS__.debounce,this._prefix=n+e.$options.name.toUpperCase()+"__"}var a,i,s;return a=o,(i=[{key:"getName",value:function(e){return this._prefix+e.toUpperCase()}},{key:"getItem",value:function(e){return this._storage.getItem(this.getName(e))}},{key:"watch",value:function(t){var o=this;"string"==typeof t&&(t=r(t),this._unwatchFns[t]||void 0===function(t,o){if("string"==typeof o)return r(o).split(".").reduce(function(t,r){return"object"===e(t)&&t.hasOwnProperty(r)?t[r]:void 0},t)}(this._vm,t)||(this._unwatchFns[t]=this._vm.$watch(t,function(e){var t,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var o=this,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];t&&clearTimeout(t),t=setTimeout(function(){e.apply(o,a)},r)}}(function(e){o._storage.setItem(o.getName(t),e)},this._debounce),{deep:!0})))}},{key:"unwatch",value:function(e){if(void 0===e){for(var t in this._unwatchFns)this._unwatchFns[t]();delete this._unwatchFns,this._unwatchFns=Object.create(null)}else e in this._unwatchFns&&(this._unwatchFns[e](),delete this._unwatchFns[e])}},{key:"clear",value:function(e){void 0===e?this._storage.clear(n):this._storage.removeItem(this.getName(e))}},{key:"destroy",value:function(){this.unwatch(),delete this._vm,delete this._prefix,delete this._storage,delete this._debounce}}])&&t(a.prototype,i),s&&t(a,s),o}();function i(e){var t;t=e.$options.autoStorage,"[object Array]"===Object.prototype.toString.call(t)&&e.$options.name&&!e.$autoStorage&&(e.$autoStorage=new a(e),function(e){for(var t,r,n=e.$options.autoStorage,a=0,i=n.length;a<i;a++)t=n[a],void 0!==(r=e.$autoStorage.getItem(t))&&o(e,t,r)}(e),function(e){for(var t=e.$options.autoStorage,r=0,o=t.length;r<o;r++)e.$autoStorage.watch(t[r])}(e))}var s={created:function(){try{i(this)}catch(e){}},beforeDestroy:function(){var e;(e=this).$autoStorage&&(e.$autoStorage.destroy(),delete e.$autoStorage)}},l={debounce:300,storage:window.localStorage},c={install:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(var r in t)l[r]=t[r];var o,n=l.storage;if(!function(e){try{return"function"==typeof e.clear&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem}catch(e){return!1}}(n))throw new Error("Invalid storage instance given");l.storage=(o=n,{setItem:function(e,t){o.setItem(e,JSON.stringify(void 0===t?null:t))},getItem:function(e){var t=o[e];return void 0===t?void 0:JSON.parse(t)},removeItem:function(e){o.removeItem(e)},clear:function(e){if(e)for(var t in o)o.hasOwnProperty(t)&&t.includes(e)&&o.removeItem(t);else o.clear()}}),Object.defineProperty(e.prototype,"__AUTO_STORAGE_OPTIONS__",{value:l}),e.mixin(s)}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(c),c})},a2c1:function(e,t,r){},c31f:function(e,t,r){"use strict";r.r(t);var o=r("8bbf"),n=r.n(o),a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-container",{attrs:{id:"app"}},[r("el-header",{attrs:{height:"auto"}},[r("h1",{staticClass:"header"},[e._v("\n      Vue Auto Storage\n\n      "),r("a",{staticClass:"star",attrs:{href:"https://github.com/zh-rocco/vue-auto-storage",target:"_blank",title:"Github"}},[r("svg",{staticClass:"icon-github",attrs:{height:"32",viewBox:"0 0 16 16",version:"1.1",width:"32","aria-hidden":"true"}},[r("path",{attrs:{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"}})])])])]),r("el-main",[r("el-row",{attrs:{gutter:40}},[r("el-col",{attrs:{span:12}},[r("el-row",{staticClass:"center"},[r("h2",[e._v("Persistent Form")])]),r("el-form",{ref:"persistentForm",attrs:{model:e.persistentForm,"label-width":"130px","label-suffix":" :"}},[r("el-form-item",{attrs:{label:"Activity name"}},[r("el-input",{model:{value:e.persistentForm.name,callback:function(t){e.$set(e.persistentForm,"name",t)},expression:"persistentForm.name"}})],1),r("el-form-item",{attrs:{label:"Activity zone"}},[r("el-select",{attrs:{placeholder:"please select your zone"},model:{value:e.persistentForm.region,callback:function(t){e.$set(e.persistentForm,"region",t)},expression:"persistentForm.region"}},[r("el-option",{attrs:{label:"Zone one",value:"shanghai"}}),r("el-option",{attrs:{label:"Zone two",value:"beijing"}})],1)],1),r("el-form-item",{attrs:{label:"Instant delivery"}},[r("el-switch",{model:{value:e.persistentForm.delivery,callback:function(t){e.$set(e.persistentForm,"delivery",t)},expression:"persistentForm.delivery"}})],1),r("el-form-item",{attrs:{label:"Activity type"}},[r("el-checkbox-group",{model:{value:e.persistentForm.type,callback:function(t){e.$set(e.persistentForm,"type",t)},expression:"persistentForm.type"}},[r("el-checkbox",{attrs:{label:"Online activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Promotion activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Offline activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Simple brand exposure",name:"type"}})],1)],1),r("el-form-item",{attrs:{label:"Resources"}},[r("el-radio-group",{model:{value:e.persistentForm.resource,callback:function(t){e.$set(e.persistentForm,"resource",t)},expression:"persistentForm.resource"}},[r("el-radio",{attrs:{label:"Sponsor"}}),r("el-radio",{attrs:{label:"Venue"}})],1)],1),r("el-form-item",{attrs:{label:"Activity form"}},[r("el-input",{attrs:{type:"textarea"},model:{value:e.persistentForm.desc,callback:function(t){e.$set(e.persistentForm,"desc",t)},expression:"persistentForm.desc"}})],1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-row",{staticClass:"center"},[r("h2",[e._v("Normal Form")])]),r("el-form",{ref:"form",attrs:{model:e.form,"label-width":"130px","label-suffix":" :"}},[r("el-form-item",{attrs:{label:"Activity name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"Activity zone"}},[r("el-select",{attrs:{placeholder:"please select your zone"},model:{value:e.form.region,callback:function(t){e.$set(e.form,"region",t)},expression:"form.region"}},[r("el-option",{attrs:{label:"Zone one",value:"shanghai"}}),r("el-option",{attrs:{label:"Zone two",value:"beijing"}})],1)],1),r("el-form-item",{attrs:{label:"Instant delivery"}},[r("el-switch",{model:{value:e.form.delivery,callback:function(t){e.$set(e.form,"delivery",t)},expression:"form.delivery"}})],1),r("el-form-item",{attrs:{label:"Activity type"}},[r("el-checkbox-group",{model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[r("el-checkbox",{attrs:{label:"Online activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Promotion activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Offline activities",name:"type"}}),r("el-checkbox",{attrs:{label:"Simple brand exposure",name:"type"}})],1)],1),r("el-form-item",{attrs:{label:"Resources"}},[r("el-radio-group",{model:{value:e.form.resource,callback:function(t){e.$set(e.form,"resource",t)},expression:"form.resource"}},[r("el-radio",{attrs:{label:"Sponsor"}}),r("el-radio",{attrs:{label:"Venue"}})],1)],1),r("el-form-item",{attrs:{label:"Activity form"}},[r("el-input",{attrs:{type:"textarea"},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc",t)},expression:"form.desc"}})],1)],1)],1)],1),r("el-row",{staticClass:"mt-l center"},[r("h3",[e._v("Just fill in the two forms above and click the button below.")])]),r("el-row",{staticClass:"mt-l center"},[r("el-button",{attrs:{type:"primary"},on:{click:e.handleReload}},[e._v("Reload Page")]),r("el-button",{on:{click:e.handleClearCurrent}},[e._v("Reload Page (with clearing storage)")])],1)],1)],1)},i=[],s={name:"App",autoStorage:["persistentForm"],data:function(){return{persistentForm:{name:"",region:"",delivery:!1,type:[],resource:"",desc:""},form:{name:"",region:"",delivery:!1,type:[],resource:"",desc:""}}},methods:{handleClearCurrent:function(){this.$autoStorage.clear("persistentForm"),location.reload()},handleReload:function(){location.reload()}}},l=s;r("42b1");function c(e,t,r,o,n,a,i,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),o&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):n&&(l=s?function(){n.call(this,this.$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:c}}var u=c(l,a,i,!1,null,null,null);u.options.__file="App.vue";var f=u.exports,p=r("5f72"),m=r.n(p),d=r("9f69"),v=r.n(d);n.a.config.productionTip=!1,n.a.use(m.a),n.a.use(v.a),new n.a({render:function(e){return e(f)}}).$mount("#app")}});
  //# sourceMappingURL=index.cc29f512.js.map