no message
Former-commit-id: 8c4efb534ec285aaa938d59984dc8d41fc3c5a64 Former-commit-id: c5569c0d346a0e2cc5b15c8a21198eba293394eb Former-commit-id: 020b99c55b3a690af6cbc4d20e9952a605b8e947
This commit is contained in:
@@ -7,17 +7,29 @@
|
||||
<el-table-column prop="id" label="id" width="50" align="center"></el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-bind="inputSetting" placeholder="姓名" :ref="`${scope.$index}${scope.column.property}`"></el-input>
|
||||
<el-input
|
||||
v-bind="inputSetting"
|
||||
placeholder="姓名"
|
||||
:ref="keyboardExtentRefNameMaker(scope)">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address1" label="出生地" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-bind="inputSetting" placeholder="出生地" :ref="`${scope.$index}${scope.column.property}`"></el-input>
|
||||
<el-input
|
||||
v-bind="inputSetting"
|
||||
placeholder="出生地"
|
||||
:ref="keyboardExtentRefNameMaker(scope)">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address2" label="现居地" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-bind="inputSetting" placeholder="现居地" :ref="`${scope.$index}${scope.column.property}`"></el-input>
|
||||
<el-input
|
||||
v-bind="inputSetting"
|
||||
placeholder="现居地"
|
||||
:ref="keyboardExtentRefNameMaker(scope)">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -26,7 +38,11 @@
|
||||
|
||||
<script>
|
||||
import Mock from 'mockjs'
|
||||
import keyboardExtent from './keyboard-extend'
|
||||
export default {
|
||||
mixins: [
|
||||
keyboardExtent
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
// 绑定到表格的数据
|
||||
@@ -45,10 +61,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
created () {
|
||||
// 自动请求数据
|
||||
this.getData()
|
||||
console.log(this.$refs)
|
||||
},
|
||||
methods: {
|
||||
// 请求数据
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
export default {
|
||||
mounted () {
|
||||
// 键盘控制扩展初始化
|
||||
this.keyboardExtentInit()
|
||||
// 写法 1 测试有效
|
||||
window.onload = () => {
|
||||
console.log(this.$refs)
|
||||
console.log('----')
|
||||
for (let prop in this.$refs) {
|
||||
console.log(this.$refs[prop])
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 键盘控制扩展初始化
|
||||
// 初始化
|
||||
keyboardExtentInit () {
|
||||
console.group('keyboardExtentInit')
|
||||
console.log()
|
||||
console.groupEnd()
|
||||
//
|
||||
},
|
||||
// 返回ref名称
|
||||
keyboardExtentRefNameMaker (scope) {
|
||||
return `${scope.$index}${scope.column.property}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user