zoukankan      html  css  js  c++  java
  • vue的坑

    1.获取地址栏参数  this.$route.query.id

    2.用this.$router.push({path:'index',query:{id:1}})跳转页面无刷新,无法监听传递的参数,可用以下方法解决:

    watch:{

      '$route':'fun'

    }

    fun为地址栏变化要写的函数

    3.组件变量是数组的,v-for时,要写:key="index";

    4.在光标处插入值

    <textarea ref="mytextarea" v-model='editMsg' class="editMsg" maxlength="333" ></textarea>
    cursorInput(str){  //光标位置插入值
    var tc = this.$refs.mytextarea;
    var tclen = this.editMsg.length;
    tc.focus();
    if(typeof document.selection != "undefined"){
    document.selection.createRange().text = str;
    }else{
    this.editMsg= this.editMsg.substr(0,tc.selectionStart)+str+this.editMsg.substring(tc.selectionStart,tclen);
    }
    },
  • 相关阅读:
    gnuplot
    charles证书安装
    jenkins 配置ssh
    jenkins 配置slave
    centos 安装jenkins
    mac的一些命令
    docker 常用命令
    GO vim环境
    go vendor目录
    protobuf
  • 原文地址:https://www.cnblogs.com/miaSlady/p/8277094.html
Copyright © 2011-2022 走看看