GauharChan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
31 additions and
6 deletions
-
src/views/demo/table/RefTable.vue
-
src/views/demo/table/UseTable.vue
|
|
|
@ -34,6 +34,7 @@ |
|
|
|
import { getBasicColumns, getBasicShortColumns } from './tableData'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { demoListApi } from '/@/api/demo/table'; |
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
components: { BasicTable }, |
|
|
|
setup() { |
|
|
|
@ -54,10 +55,22 @@ |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
function changeColumns() { |
|
|
|
getTableAction().setColumns(getBasicShortColumns()); |
|
|
|
getTableAction().setProps({ |
|
|
|
columns: getBasicShortColumns(), |
|
|
|
rowSelection: { |
|
|
|
type: 'checkbox', |
|
|
|
}, |
|
|
|
showIndexColumn: true, |
|
|
|
}); |
|
|
|
} |
|
|
|
function reloadTable() { |
|
|
|
getTableAction().setColumns(getBasicColumns()); |
|
|
|
getTableAction().setProps({ |
|
|
|
columns: getBasicColumns(), |
|
|
|
rowSelection: { |
|
|
|
type: 'checkbox', |
|
|
|
}, |
|
|
|
showIndexColumn: true, |
|
|
|
}); |
|
|
|
|
|
|
|
getTableAction().reload({ |
|
|
|
page: 1, |
|
|
|
|
|
|
|
@ -25,6 +25,7 @@ |
|
|
|
import { getBasicColumns, getBasicShortColumns } from './tableData'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { demoListApi } from '/@/api/demo/table'; |
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
components: { BasicTable }, |
|
|
|
setup() { |
|
|
|
@ -36,7 +37,7 @@ |
|
|
|
registerTable, |
|
|
|
{ |
|
|
|
setLoading, |
|
|
|
setColumns, |
|
|
|
setProps, |
|
|
|
getColumns, |
|
|
|
getDataSource, |
|
|
|
getRawDataSource, |
|
|
|
@ -76,11 +77,22 @@ |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
function changeColumns() { |
|
|
|
setColumns(getBasicShortColumns()); |
|
|
|
setProps({ |
|
|
|
columns: getBasicShortColumns(), |
|
|
|
rowSelection: { |
|
|
|
type: 'checkbox', |
|
|
|
}, |
|
|
|
showIndexColumn: true, |
|
|
|
}); |
|
|
|
} |
|
|
|
function reloadTable() { |
|
|
|
setColumns(getBasicColumns()); |
|
|
|
|
|
|
|
setProps({ |
|
|
|
columns: getBasicColumns(), |
|
|
|
rowSelection: { |
|
|
|
type: 'checkbox', |
|
|
|
}, |
|
|
|
showIndexColumn: true, |
|
|
|
}); |
|
|
|
reload({ |
|
|
|
page: 1, |
|
|
|
}); |
|
|
|
|