zoukankan      html  css  js  c++  java
  • 表单失去焦点校验数据后,有问题的焦点激活

     <el-input
                      v-model="scope.row.setMaxScore"
                      :ref="`inputRefs${scope.$index}`"
                      size="small"
                      @blur="changeMax
                    (scope.$index,scope.row)"
    
                    ></el-input>
        //鼠标离开
        changeMax(index, row) {
          this.rowIndex = index;
         this.maxScore = row.setMaxScore;
          this.minScore = row.setMinScore;
          if(this.minScore!=''&&this.maxScore==''){
            return
          }
          else{
            if(Number(this.minScore) >=Number(this.maxScore)){
          this.$message.error('第'+(this.rowIndex+1)+'行最大值应该大于最小值')
          this.$refs[`inputRefs${index}`].focus()

    //有的时候要加
    [0]
    this.$refs[`stepInputRefs${mindex}a${index}`][0].focus();
          }
          }
    
        },
    export default {
      name: "SetGrade",
      components: {},
      
      directives: {
        focus: {
            // 指令的定义
            inserted: function(el){
                el.focus()
            }
        }
      },
    }
  • 相关阅读:
    c++ 虚继承与继承的差异 (转)
    主题:PageRank解释
    (转)开源爬虫larbin分析
    Django随笔
    原生爬虫小Demo
    SVN
    Python的正则表达式与JSON
    类库 方法 模块等
    笔记
    自动补全Typeahead
  • 原文地址:https://www.cnblogs.com/dianzan/p/13596586.html
Copyright © 2011-2022 走看看