index.vue 657 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <el-select ref="selectRef" v-bind="$attrs">
  3. <el-option v-for="option in dataList" :key="option.id" :label="option.name" :value="option.id" />
  4. </el-select>
  5. </template>
  6. <script setup>
  7. import { listUniversity } from '@/api/dz/school';
  8. import { nextTick, onMounted } from 'vue';
  9. const props = defineProps({
  10. deptId: {
  11. type: Number,
  12. default: null,
  13. },
  14. });
  15. const selectRef = ref(null);
  16. const dataList = ref([])
  17. const loadData = async () => {
  18. const { rows } = await listUniversity({
  19. pageNum: 1,
  20. pageSize: 100000
  21. })
  22. dataList.value = rows;
  23. }
  24. onMounted(() => {
  25. loadData();
  26. });
  27. </script>
  28. <style lang="scss" scoped></style>