vue element el-input 输入框当内容长度超出时现示el-tooltip提示

html

    <el-form-item label="派驻寿险机构" prop="lifeComName">
          <el-tooltip :disabled="disabledTooltip" effect="dark" :content="ruleForm.lifeComNameStr" placement="top">
            <el-input ref="lifeComNameStr" v-model="ruleForm.lifeComNameStr" type="text" disabled class="control"/>
          </el-tooltip>
        </el-form-item>

js

  data() {
    
        disabledTooltip: true,
},
methods: {
      showTooltip() {
        const lifeW = this.$refs.lifeComNameStr
        this.disabledTooltip = lifeW.value.length < 20
      },
}

你可能感兴趣的:(vue,element组件,vue.js,javascript,sass)