import { App } from 'vue' import NdButton from './button' import AdjustCard from './adjustCard' import ModeCard from './modeCard' import FunctionSwitch from './functionSwitch' import TopBar from './topBar' import PowerSwitch from './powerSwitch' import TLayout from './tLayout' import FunctionCard from './functionCard' import DropdownMenu from './dropdownMenu' import ScreenCell from './screenCell' // 所有组件列表 const components = [NdButton, AdjustCard, ModeCard, FunctionSwitch, TopBar, PowerSwitch, FunctionCard, TLayout, DropdownMenu, ScreenCell] // 定义 install 方法, App 作为参数 const install = (app: App): void => { // 遍历注册所有组件 components.map((component) => { if(component.name) app.component(component.name, component) if(component.__name) app.component(component.__name, component) }); } export { NdButton, AdjustCard, ModeCard, FunctionSwitch, TopBar, PowerSwitch, TLayout, FunctionCard, DropdownMenu, ScreenCell, } export default { install }