Coder Social home page Coder Social logo

juzikong's Introduction

juzikong

  • localStorage.setItem(key, String), set的值必须是字符串,如果你的数据是对象都需要先行转换(JSON.stringify(xxx)),取出时localStorage.getItem(key),如果不是字符串,取出后可以通过JSON.parse(xxx)转回对象。

  • axios 传递query参数params时须有user_id: user_id export function getOtherUserInfo(user_id) { return axios('/admin/getOtherUserInfo', { params: { user_id: user_id } }) }

  • dialog作组件时不能点击遮罩层或者右上方进行关闭,会直接改变props(子组件不允许直接修改父组件传过来的prop)

  • 前置钩子偶尔不能显示meta

 router.beforeEach((to, from, next) => {
   // 从from跳转到to   
   document.title = to.matched[0].meta.title;
  // console.log(to);
   next();
 }) 
  • 子路由的path前面不加斜杠\

  • $router.push跳转界面不刷新(一般跳本界面):watch监听$route(to),打印to

  • 单行文本垂直居中height=line-height

  • pre自动换行要设置 white-space: pre-wrap;

  • 导航组件重复点击报错 NavigationDuplicated(也就是说这是vue-router3.1版本之后,对于航组件重复点击的一个错误处理方式。)

    • 降版
    • 禁止全局路由错误处理打印(在引用VueRouter处添加)
      •    VueRouter.prototype.push = function push(location, onResolve, onReject) {
             if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
             return originalPush.call(this, location).catch(err => err)
           }
        
           const originalReplace = VueRouter.prototype.replace
           VueRouter.prototype.replace = function repalce(location, onResolve, onReject) {
             if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject)
             return originalReplace.call(this, location).catch(err => err)
           }```    
        
    • 为每一个增加回调函数
      • this.$router.push('/location').catch(err => {err});
      • this.$router.replace('/location').catch(err => {err});

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Customize configuration

See Configuration Reference.

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.