codercup / unibest

unibest - 最好用的 uniapp 开发框架。unibest 是由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI 驱动的跨端快速启动模板,使用 VS Code 开发,具有代码提示、自动格式化、统一配置、代码片段等功能,同时内置了大量平时开发常用的基本组件,开箱即用,让你编写 uniapp 拥有 best 体验。
https://codercup.github.io/unibest-docs/
MIT License
1.81k stars 214 forks source link

在webstorm里面没有wot design ui的组件提示 #183

Open qgqceo opened 4 days ago

qgqceo commented 4 days ago

如下图所示,没有提示: 001

228443632 commented 3 days ago

我知道

228443632 commented 3 days ago

在项目的根路径下创建 global.d.ts文件

declare module 'vue' {
  export interface GlobalComponents {
    WdActionSheet: (typeof import('wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue'))['default']
    WdBadge: (typeof import('wot-design-uni/components/wd-badge/wd-badge.vue'))['default']
    WdButton: (typeof import('wot-design-uni/components/wd-button/wd-button.vue'))['default']
    WdCalendar: (typeof import('wot-design-uni/components/wd-calendar/wd-calendar.vue'))['default']
    WdCalendarView: (typeof import('wot-design-uni/components/wd-calendar-view/wd-calendar-view.vue'))['default']
    WdCard: (typeof import('wot-design-uni/components/wd-card/wd-card.vue'))['default']
    WdCell: (typeof import('wot-design-uni/components/wd-cell/wd-cell.vue'))['default']
    WdCellGroup: (typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue'))['default']
    WdCheckbox: (typeof import('wot-design-uni/components/wd-checkbox/wd-checkbox.vue'))['default']
    WdCheckboxGroup: (typeof import('wot-design-uni/components/wd-checkbox-group/wd-checkbox-group.vue'))['default']
    WdCol: (typeof import('wot-design-uni/components/wd-col/wd-col.vue'))['default']
    WdColPicker: (typeof import('wot-design-uni/components/wd-col-picker/wd-col-picker.vue'))['default']
    WdCollapse: (typeof import('wot-design-uni/components/wd-collapse/wd-collapse.vue'))['default']
    WdCollapseItem: (typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue'))['default']
    WdConfigProvider: (typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue'))['default']
    WdCurtain: (typeof import('wot-design-uni/components/wd-curtain/wd-curtain.vue'))['default']
    WdDatetimePicker: (typeof import('wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue'))['default']
    WdDatetimePickerView: (typeof import('wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue'))['default']
    WdDivider: (typeof import('wot-design-uni/components/wd-divider/wd-divider.vue'))['default']
    WdDropMenu: (typeof import('wot-design-uni/components/wd-drop-menu/wd-drop-menu.vue'))['default']
    WdDropMenuItem: (typeof import('wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue'))['default']
    WdGrid: (typeof import('wot-design-uni/components/wd-grid/wd-grid.vue'))['default']
    WdGridItem: (typeof import('wot-design-uni/components/wd-grid-item/wd-grid-item.vue'))['default']
    WdIcon: (typeof import('wot-design-uni/components/wd-icon/wd-icon.vue'))['default']
    WdImg: (typeof import('wot-design-uni/components/wd-img/wd-img.vue'))['default']
    WdImgCropper: (typeof import('wot-design-uni/components/wd-img-cropper/wd-img-cropper.vue'))['default']
    WdInput: (typeof import('wot-design-uni/components/wd-input/wd-input.vue'))['default']
    WdInputNumber: (typeof import('wot-design-uni/components/wd-input-number/wd-input-number.vue'))['default']
    WdLoading: (typeof import('wot-design-uni/components/wd-loading/wd-loading.vue'))['default']
    WdLoadmore: (typeof import('wot-design-uni/components/wd-loadmore/wd-loadmore.vue'))['default']
    WdMessageBox: (typeof import('wot-design-uni/components/wd-message-box/wd-message-box.vue'))['default']
    WdOverlay: (typeof import('wot-design-uni/components/wd-overlay/wd-overlay.vue'))['default']
    WdNoticeBar: (typeof import('wot-design-uni/components/wd-notice-bar/wd-notice-bar.vue'))['default']
    WdPagination: (typeof import('wot-design-uni/components/wd-pagination/wd-pagination.vue'))['default']
    WdPicker: (typeof import('wot-design-uni/components/wd-picker/wd-picker.vue'))['default']
    WdPickerView: (typeof import('wot-design-uni/components/wd-picker-view/wd-picker-view.vue'))['default']
    WdPopover: (typeof import('wot-design-uni/components/wd-popover/wd-popover.vue'))['default']
    WdPopup: (typeof import('wot-design-uni/components/wd-popup/wd-popup.vue'))['default']
    WdProgress: (typeof import('wot-design-uni/components/wd-progress/wd-progress.vue'))['default']
    WdRadio: (typeof import('wot-design-uni/components/wd-radio/wd-radio.vue'))['default']
    WdRadioGroup: (typeof import('wot-design-uni/components/wd-radio-group/wd-radio-group.vue'))['default']
    WdRate: (typeof import('wot-design-uni/components/wd-rate/wd-rate.vue'))['default']
    WdResize: (typeof import('wot-design-uni/components/wd-resize/wd-resize.vue'))['default']
    WdRow: (typeof import('wot-design-uni/components/wd-row/wd-row.vue'))['default']
    WdSearch: (typeof import('wot-design-uni/components/wd-search/wd-search.vue'))['default']
    WdSelectPicker: (typeof import('wot-design-uni/components/wd-select-picker/wd-select-picker.vue'))['default']
    WdSlider: (typeof import('wot-design-uni/components/wd-slider/wd-slider.vue'))['default']
    WdSortButton: (typeof import('wot-design-uni/components/wd-sort-button/wd-sort-button.vue'))['default']
    WdStatusTip: (typeof import('wot-design-uni/components/wd-status-tip/wd-status-tip.vue'))['default']
    WdStep: (typeof import('wot-design-uni/components/wd-step/wd-step.vue'))['default']
    WdSteps: (typeof import('wot-design-uni/components/wd-steps/wd-steps.vue'))['default']
    WdSticky: (typeof import('wot-design-uni/components/wd-sticky/wd-sticky.vue'))['default']
    WdStickyBox: (typeof import('wot-design-uni/components/wd-sticky-box/wd-sticky-box.vue'))['default']
    WdSwipeAction: (typeof import('wot-design-uni/components/wd-swipe-action/wd-swipe-action.vue'))['default']
    WdSwitch: (typeof import('wot-design-uni/components/wd-switch/wd-switch.vue'))['default']
    WdTab: (typeof import('wot-design-uni/components/wd-tab/wd-tab.vue'))['default']
    WdTabs: (typeof import('wot-design-uni/components/wd-tabs/wd-tabs.vue'))['default']
    WdTag: (typeof import('wot-design-uni/components/wd-tag/wd-tag.vue'))['default']
    WdToast: (typeof import('wot-design-uni/components/wd-toast/wd-toast.vue'))['default']
    WdTooltip: (typeof import('wot-design-uni/components/wd-tooltip/wd-tooltip.vue'))['default']
    WdTransition: (typeof import('wot-design-uni/components/wd-transition/wd-transition.vue'))['default']
    WdUpload: (typeof import('wot-design-uni/components/wd-upload/wd-upload.vue'))['default']
    WdNotify: (typeof import('wot-design-uni/components/wd-notify/wd-notify.vue'))['default']
    WdWatermark: (typeof import('wot-design-uni/components/wd-watermark/wd-watermark.vue'))['default']
    WdCircle: (typeof import('wot-design-uni/components/wd-circle/wd-circle.vue'))['default']
    WdSwiper: (typeof import('wot-design-uni/components/wd-swiper/wd-swiper.vue'))['default']
    WdSwiperNav: (typeof import('wot-design-uni/components/wd-swiper-nav/wd-swiper-nav.vue'))['default']
    WdSegmented: (typeof import('wot-design-uni/components/wd-segmented/wd-segmented.vue'))['default']
    WdTabbar: (typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue'))['default']
    WdTabbarItem: (typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue'))['default']
    WdNavbar: (typeof import('wot-design-uni/components/wd-navbar/wd-navbar.vue'))['default']
    WdNavbarCapsule: (typeof import('wot-design-uni/components/wd-navbar-capsule/wd-navbar-capsule.vue'))['default']
    WdTable: (typeof import('wot-design-uni/components/wd-table/wd-table.vue'))['default']
    WdTableCol: (typeof import('wot-design-uni/components/wd-table-col/wd-table-col.vue'))['default']
    WdSidebar: (typeof import('wot-design-uni/components/wd-sidebar/wd-sidebar.vue'))['default']
    WdSidebarItem: (typeof import('wot-design-uni/components/wd-sidebar-item/wd-sidebar-item.vue'))['default']
    WdFab: (typeof import('wot-design-uni/components/wd-fab/wd-fab.vue'))['default']
    WdCountDown: (typeof import('wot-design-uni/components/wd-count-down/wd-count-down.vue'))['default']
    WdNumberKeyboard: (typeof import('wot-design-uni/components/wd-number-keyboard/wd-number-keyboard.vue'))['default']
    WdGap: (typeof import('wot-design-uni/components/wd-gap/wd-gap.vue'))['default']
    WdPasswordInput: (typeof import('wot-design-uni/components/wd-password-input/wd-password-input.vue'))['default']
    WdForm: (typeof import('wot-design-uni/components/wd-form/wd-form.vue'))['default']
    WdTextarea: (typeof import('wot-design-uni/components/wd-textarea/wd-textarea.vue'))['default']
    WdVideoPreview: (typeof import('wot-design-uni/components/wd-video-preview/wd-video-preview.vue'))['default']
    WdBacktop: (typeof import('wot-design-uni/components/wd-backtop/wd-backtop.vue'))['default']
    WdSkeleton: (typeof import('wot-design-uni/components/wd-skeleton/wd-skeleton.vue'))['default']
    WdIndexBar: (typeof import('wot-design-uni/components/wd-index-bar/wd-index-bar.vue'))['default']
    WdIndexAnchor: (typeof import('wot-design-uni/components/wd-index-anchor/wd-index-anchor.vue'))['default']
    WdText: (typeof import('wot-design-uni/components/wd-text/wd-text.vue'))['default']
    WdCountTo: (typeof import('wot-design-uni/components/wd-count-to/wd-count-to.vue'))['default']
  }

  interface ComponentCustomProperties {
    // $message: typeof import('./packages/shared-base/Anchor')['ElMessage']
    $xss: (typeof import('xss'))['default']
    $dayjs: (typeof import('dayjs'))['default']
  }
}
export {}

declare global {
  /**
   * 申明挂载到window上
   */
  interface global {
    $sharedRepo: {}
    tippy: any
  }
  interface Window extends global {}
  const $sharedRepo: {}
}

找到tsconfig.json include字段中添加

"./global.d.ts"
image