This commit is contained in:
xuliangzhan
2019-05-23 19:03:33 +08:00
parent 094e3d55b3
commit d4e533d5d5
4 changed files with 10 additions and 11 deletions

View File

@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/vxe-table/favicon.ico><title>vxe-table 表格</title><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=preload as=style><link href=/vxe-table/static/css/index.5d8d71a8.css rel=preload as=style><link href=/vxe-table/static/js/chunk-vendors.59abef37.js rel=preload as=script><link href=/vxe-table/static/js/index.9affdf58.js rel=preload as=script><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=stylesheet><link href=/vxe-table/static/css/index.5d8d71a8.css rel=stylesheet></head><body><noscript><strong>We're sorry but vxe-table doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/vxe-table/static/js/chunk-vendors.59abef37.js></script><script src=/vxe-table/static/js/index.9affdf58.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/vxe-table/favicon.ico><title>vxe-table 表格</title><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=preload as=style><link href=/vxe-table/static/css/index.5d8d71a8.css rel=preload as=style><link href=/vxe-table/static/js/chunk-vendors.59abef37.js rel=preload as=script><link href=/vxe-table/static/js/index.d96e8b8e.js rel=preload as=script><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=stylesheet><link href=/vxe-table/static/css/index.5d8d71a8.css rel=stylesheet></head><body><noscript><strong>We're sorry but vxe-table doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/vxe-table/static/js/chunk-vendors.59abef37.js></script><script src=/vxe-table/static/js/index.d96e8b8e.js></script></body></html>

File diff suppressed because one or more lines are too long

1
docs/static/js/index.d96e8b8e.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -22,7 +22,7 @@
<code class="javascript">{{ demoCodes[1] }}</code>
</pre>
<P>配合自定义渲染第三行name禁止编辑禁</P>
<P>配合自定义渲染第三行name禁止编辑禁 age 小于 26</P>
<vxe-table
ref="xTable"
@@ -36,9 +36,9 @@
<input type="text" v-model="row.name">
</template>
</vxe-table-column>
<vxe-table-column prop="sex" label="Sex" :edit-render="{type: 'default'}">
<template v-slot:edit="{ row }">
<input type="sex" v-model="row.name" :disabled="row.disabled">
<vxe-table-column prop="age" label="Age" :edit-render="{type: 'default'}">
<template v-slot:edit="scope">
<input type="text" v-model="scope.row.name" :disabled="disableMethod(scope)">
</template>
</vxe-table-column>
<vxe-table-column prop="date" label="Date" :edit-render="{type: 'default'}">
@@ -146,11 +146,7 @@ export default {
},
created () {
let list = window.MOCK_DATA_LIST.slice(0, 6)
this.tableData = list.map((item, index) => {
return Object.assign({
disabled: index === 2
}, item)
})
this.tableData = list
},
mounted () {
Array.from(this.$el.querySelectorAll('pre code')).forEach((block) => {
@@ -161,6 +157,9 @@ export default {
activeRowMethod ({ row, rowIndex }) {
return rowIndex !== 1
},
disableMethod ({ row, column }) {
return column.property === 'age' && row.age < 26
},
editDisabledEvent ({ row, column }) {
alert('禁止编辑')
}