Git Product home page Git Product logo

vue-management's Introduction

project

A Vue.js project

Image text Image text Image text Image text Image text Image text Image text Image text Image text

##Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

  1. vue配合vuex和本地存储可以减少HTTP请求,进行优化

  2. 本地储存:sessionStorage、localStorage和cookie之间的异同

    共同点:都是保存在浏览器端,且同源的。

    区别:cookie数据始终在同源的http请求中携带(即使不需要),即cookie在浏览器和服务器间

    ​ 来回传递

    ​ cookie数据不能超过4KB,同时因为每次http请求都会携带cookie,所以cookie只适合保存很小的数据,如短字符等

    ​ 而sessionStorage和localStorage虽然也有存储大小的限制,一般为5M

    ​ 数据有效期也不同,sessionStorage:仅在当前浏览器窗口关闭前有效,不能持久保存

    ​ localStorage:始终有效,窗口或浏览器关闭也一直保存,因此用作持久数据;

    ​ cookie只在设置的cookie过期时间之前一直有效,即使窗口或浏览器关闭

  3. 本地存储的方法

    • setItem(key,val) 设置值
    • getItem(key) 获取值
    • key(index) 获取key
    • removeItem(key)删除值
    • clear() 清空所有储存

vue-management's People

Contributors

378406712 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.