You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
  1. ### mdp-select-table 效果图
  2. - 该组件与mdp-select效果一致,同样支持origin/tag/x三种风格,不同之处在于具有分页功能,适合超大表格数据的选择,如下图1所示,默认只会展示用过的数据,如果需要更多数据,需要点击【更多数据】按钮,将会弹出图2所示,当用户选中数据后,数据将填充到图1的下拉列表中,并且能够模拟select的选中事件
  3. ![mdp-select-table-select](/docs/images/ui-components/mdp-select-table-select.png)
  4. ![mdp-select-table](/docs/images/ui-components/mdp-select-table.png)
  5. ### 用法
  6. #### 通过属性columnCfgs传入表格字段列表,mdp框架将解析出表头内容,用于配置显示列,排序,高级查询等
  7. ```html
  8. <mdp-select-table show-style="origin" :load-fun="loadFun" :column-cfgs="columnCfgs">
  9. </mdp-select-table>
  10. ```
  11. ```js
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. //从后台加载数据的api
  17. loadFun:this.$mdp.listBranch,
  18. columnCfgs:{
  19. [
  20. {label:'机构编号',property:'id'},
  21. {label:'机构名称',property:'branchName'},
  22. {label:'地址',property:'address'},
  23. ]
  24. }
  25. }
  26. }
  27. }
  28. </script>
  29. ```
  30. #### 多选、单选模式
  31. ```html
  32. <mdp-select-table show-style="origin" :load-fun="loadFun" :column-cfgs="columnCfgs" :multiple="true">
  33. </mdp-select-table>
  34. ```
  35. ```js
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. //从后台加载数据的api
  41. loadFun:this.$mdp.listBranch,
  42. columnCfgs:{
  43. [
  44. {label:'机构编号',property:'id'},
  45. {label:'机构名称',property:'branchName'},
  46. {label:'地址',property:'address'},
  47. ]
  48. }
  49. }
  50. }
  51. }
  52. </script>
  53. ```
  54. ### Attributes
  55. 相关配置与mdp-table一摸一样,具体查看
  56. [mdp-table](/src/components/mdp-ui/mdp-table)