vue 自定义指令

2019-04-22  本文已影响0人  张xiao蛋
          <div @dblclick="inputUP(scope.row._id)" v-show="ISinput!==scope.row._id">{{scope.row.paixu}}</div>
          <el-input
            v-model="scope.row.paixu"
            placeholder="请输入内容"
            v-show="ISinput===scope.row._id"
            v-focus
            @blur="blurIpunt"></el-input>
 directives: {
    focus:function (el) {
      el.children[0].focus();
    }
  },
data() {
    return {
      ISinput:'',
  }
}
  methods: {
    // 失去焦点
    blurIpunt () {
      this.ISinput = ''
    },
    //双击
    inputUP (ISinput) {
      this.ISinput = ISinput
    },
}
上一篇下一篇

猜你喜欢

热点阅读