brand.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div id="page">
  3. <searchForm :searchFormData="searchFormData" @handleSearch="handleSearch">
  4. <template #button>
  5. <el-button type="success">新增</el-button>
  6. <el-button type="danger">删除</el-button>
  7. </template>
  8. </searchForm>
  9. <tableForm />
  10. </div>
  11. </template>
  12. <script>
  13. import {
  14. defineComponent,
  15. reactive,
  16. ref,
  17. toRefs,
  18. onMounted,
  19. getCurrentInstance,
  20. } from "vue";
  21. import { useRoute, useRouter } from "vue-router";
  22. import searchForm from "@/components/searchForm/index.vue";
  23. import tableForm from "@/components/tableForm/index.vue";
  24. export default defineComponent({
  25. components: { searchForm, tableForm },
  26. setup(props) {
  27. const { ctx } = getCurrentInstance();
  28. const data = reactive({
  29. searchFormData: {
  30. btnList: [
  31. {
  32. type: "bind",
  33. text: "绑定主播",
  34. function: ctx.bindLive,
  35. },
  36. {
  37. type: "add",
  38. text: "新增",
  39. function: null,
  40. },
  41. {
  42. type: "edit",
  43. text: "修改",
  44. function: null,
  45. },
  46. {
  47. type: "delete",
  48. text: "删除",
  49. function: null,
  50. },
  51. ],
  52. searchList: [
  53. {
  54. type: "input",
  55. model: "input_data",
  56. inputType: "text",
  57. },
  58. {
  59. type: "select",
  60. model: "select_data",
  61. options: [
  62. {
  63. value: "Option1",
  64. label: "Option1",
  65. },
  66. {
  67. value: "Option2",
  68. label: "Option2",
  69. },
  70. {
  71. value: "Option3",
  72. label: "Option3",
  73. },
  74. {
  75. value: "Option4",
  76. label: "Option4",
  77. },
  78. {
  79. value: "Option5",
  80. label: "Option5",
  81. },
  82. ],
  83. },
  84. ],
  85. },
  86. });
  87. onMounted(() => {});
  88. const handleSearch = (res) => {
  89. console.log("handleSearch", res);
  90. };
  91. return {
  92. handleSearch,
  93. ...toRefs(data),
  94. };
  95. },
  96. });
  97. </script>
  98. <style scoped lang="scss"></style>