zoukankan      html  css  js  c++  java
  • Vue 一些零零散散~

    1. F5刷新不会触发vue的destroyed事件.

    2. computed 的 vuex 数据 ------>   beforeCreated: undefined   /    created: 有数据.

    3. vue打包后会产生map文件. map文件作用是打包后还能精准定位代码错误位置 . 取消方法 ------> /config/index.js  /   productionSourceMap:false .

    4. vue中input框监听回车键  ------->    @keyup.enter="fn()" .

    5. vue中input自动聚焦

    1 directives: { 
    2     focus: { 
    3       inserted: function (el) { 
    4          el.focus() 
    5       } 
    6     } 
    7 }    
    1 <input v-focus />

     6. vuex 的 v-model 双向数据绑定

    computed: {
        getVal: {
            get() {
                 return this.$store.state.val
            },
             set(newVal) {
                 this.$store.commit('handleVal', newVal)
             }
        }
    }
    <input v-model="getVal" />

     7. computed 属性不能修改, 如果需要在computed属性的基础上修改数据, 在created中赋值给data, 然后维护data;

    8. vue-cli 在ie上打不开的问题, npm i babel-polyfill -D , 在main.js中引入 Import "babel-polyfill" , 在build/webpack.base.conf.js中, entry : ["babel-polyfill",'./src/main.js']   搞定!!

    9. nuxt.js 苹果跳路由用params传参数传不过来, 用query传

  • 相关阅读:
    P4213【模板】杜教筛
    【SDOI2006】线性方程组
    【AHOI2018】排列
    【NOI2001】炮兵阵地
    【NOIP2012】疫情控制
    【AHKOI2017】rexp
    【十二省联考2019】春节十二响
    【TJOI2014】匹配
    【AT2645】Exhausted?
    P3809 【模板】后缀排序
  • 原文地址:https://www.cnblogs.com/spotman/p/11043962.html
Copyright © 2011-2022 走看看