import { defineNuxtPlugin } from '#app';
import {
  Table as TTable,
  HeadMenu as THeadMenu,
  MenuItem as TMenuItem,
  Icon as TIcon,
  Button as TButton,
  Header as Theader,
  Footer as TFooter,
  Content as TContent,
  Layout as Tlayout,
  Input as TInput,
  Drawer as TDrawer,
  Loading as TLoading,
  TabPanel as TTabPanel,
  Tabs as TTabs,
  Tooltip as TTooltip,
  Select as TSelect,
  Popup as TPopup,
  Dialog as TDialog,
  Form as TForm,
  FormItem as TFormItem,
  Option as TOption,
  Switch as TSwitch,
  RadioGroup as TRadioGroup,
  Pagination as TPagination,
  RadioButton as TRadioButton,
  InputNumber as TInputNumber,
  DatePicker as TDatePicker,
  TimePicker as TTimePicker,
  Row as TRow,
  Col as TCol,
  Checkbox as TCheckbox,
  Divider as TDivider,
  Swiper as TSwiper,
  SwiperItem as TSwiperItem,
} from 'tdesign-vue-next';
const components = [
  THeadMenu,
  TMenuItem,
  TIcon,
  TButton,
  Theader,
  TFooter,
  TContent,
  Tlayout,
  TInput,
  TDrawer,
  TLoading,
  TTabPanel,
  TTabs,
  TTooltip,
  TSelect,
  TPopup,
  TDialog,
  TForm,
  TFormItem,
  TOption,
  TSwitch,
  TRadioGroup,
  TPagination,
  TRadioButton,
  TInputNumber,
  TDatePicker,
  TTimePicker,
  TRow,
  TCol,
  TCheckbox,
  TDivider,
  TSwiper,
  TSwiperItem,
];
// 无法循环挂载的组件--单独拎出来
const oncomponents = [TTable];
export default defineNuxtPlugin((nuxtApp) => {
  components.forEach((item: any) => {
    nuxtApp.vueApp.use(item);
  });
  nuxtApp.vueApp.component('t-table', oncomponents[0]);
});
