H5 localStorage入门

定义

只读的 localStorage 允许你访问一个 Document 的远端(origin)对象 Storage;数据存储为跨浏览器会话。localStorage 类似于 sessionStorage,区别在于,数据存储在 localStorage 是无期限的,而数据存储在 sessionStorage 会被清除,当页面会话结束时——也就是说当页面被关闭。

属性

length

localStorage 内键值对的数量。

"H5 localStorage入门"继续阅读

vue-router路由懒加载

正常配置

import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/pages/login'
import Capture from '@/components/pages/capture'
import List from '@/components/pages/list'
import CaptureFail from '@/components/pages/capture-fail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/capture',
      name: 'Capture',
      component: Capture
    },
    {
      path: '/list',
      name: 'List',
      component: List
    },
    {
      path: '/capture-fail',
      name: 'CaptureFail',
      component: CaptureFail
    }
  ]
})

"vue-router路由懒加载"继续阅读