Guoguo-notes
主页
  • 常用笔记
  • 飞码篇
  • Java
  • React笔记
  • 袁果锅生态
GitHub
主页
  • 常用笔记
  • 飞码篇
  • Java
  • React笔记
  • 袁果锅生态
GitHub
  • 常用笔记

    • CSS 封装.md
    • CSS笔记.md
    • Echarts.md
    • Element Plus --vue3.0.md
    • Element ui 笔记.md
    • Git 代码管理.md
    • Html 笔记.md
    • Taro.md
    • TypeScript.md
    • Vue 代码片段.md
    • Vue 全局封装 main.js.md
    • Vue 笔记.md
    • Vue3 .md
    • Vue3+Element Plus.md
    • axios 请求拦截.md
    • ecahrts 使用地图报错问题.md
    • element plus 本地启动.md
    • jsx tsx 代码片段.md
    • jsx tsx 笔记.md
    • js常规.md
    • npm.md
    • sh 笔记.md
    • uniapp笔记.md
    • valibot校验学习.md
    • vite 笔记.md
    • vite手写插件.md
    • vue.js 下载文件.md
    • vueuse笔记.md
    • vxe-table笔记.md
    • 云开发教程.md
    • 公共API接口.md
    • 小程序笔记.md
    • 常用插件.md
    • 插件库.md
    • 服务器.md
    • 服务器部署教学.md
    • 毕业设计接单.md
    • 汇智腾远笔记.md
    • 浏览器px to rem适配.md
    • 登录流程.md
    • 登录逻辑.md
    • 网站配色.md
    • 视频播放插件.md
    • 解析数学公式.md
    • 跨域代理.md

动态添加输入框并获取焦点

注意一定要加 edit-render="{ autofocus: '.vxe-input--inner' }"

<vxe-table-column field="coption" title="选项" align="center"
                  :edit-render="{ autofocus: '.vxe-input--inner' }">
    <template #edit="scope">
        <vxe-input type="text" v-model="scope.row.coption" :disabled="formDisabled"
                   @change="$refs.xTable.updateStatus(scope)"></vxe-input>
    </template>
</vxe-table-column>
const $table = this.$refs.xTable2
const record = {
    serialNum: this.zm[this.tableData.length],
    coption: '',
}
const { row: newRow } = await $table.insertAt(record, row)
await $table.setEditCell(newRow, 'coption')
this.tableData.push(newRow)
Edit this page
Last Updated:
Contributors: 袁果锅
Prev
vueuse笔记.md
Next
云开发教程.md