单选和多选在table里的报错问题Blocked aria-hidden on a <input> element because the element that just

单选在main.js里
//table单选报错问题
Vue.directive('removeAriaHidden', {
  bind(el, binding) {
    const ariaEls = el.querySelectorAll('.el-radio__original')
    ariaEls.forEach((item) => {
      item.removeAttribute('aria-hidden')
    })
  }
})
多选在main.js里
//table单选报错问题
Vue.directive('removeAriaHidden', {
  bind(el, binding) {
    const ariaEls = el.querySelectorAll('.el-checkbox__original')
    ariaEls.forEach((item) => {
      item.removeAttribute('aria-hidden')
    })
  }
})
使用
<el-radio v-model="enterpriseIds" :label="scope.row.sort" @input="onRowSelected(scope.row)" v-removeAriaHidden />
或者
<el-radio-group v-model="ruleForm.isLimit" v-removeAriaHidden>
  <el-radio :value="2" :label="false" size="large">否</el-radio>
  <el-radio :value="1" :label="true" size="large">是</el-radio>
</el-radio-group>

 

posted @ 2024-09-12 14:47  prince11  阅读(1252)  评论(0编辑  收藏  举报