chore: improve withInstall typing (#9354)

* chore: improve withInstall typing

* chore: upd

* fix: missing entry
This commit is contained in:
neverland 2021-08-30 20:10:14 +08:00 committed by GitHub
parent 4cf5a6ba0d
commit 140fa0c180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 92 additions and 254 deletions

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _ActionBarButton from './ActionBarButton';
const ActionBarButton = withInstall<typeof _ActionBarButton>(_ActionBarButton);
export const ActionBarButton = withInstall(_ActionBarButton);
export default ActionBarButton;
export { ActionBarButton };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _ActionBarIcon from './ActionBarIcon';
const ActionBarIcon = withInstall<typeof _ActionBarIcon>(_ActionBarIcon);
export const ActionBarIcon = withInstall(_ActionBarIcon);
export default ActionBarIcon;
export { ActionBarIcon };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _ActionBar from './ActionBar';
const ActionBar = withInstall<typeof _ActionBar>(_ActionBar);
export const ActionBar = withInstall(_ActionBar);
export default ActionBar;
export { ActionBar };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _ActionSheet from './ActionSheet';
const ActionSheet = withInstall<typeof _ActionSheet>(_ActionSheet);
export const ActionSheet = withInstall(_ActionSheet);
export default ActionSheet;
export { ActionSheet };
export type { ActionSheetAction } from './ActionSheet';

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _AddressEdit from './AddressEdit';
const AddressEdit = withInstall<typeof _AddressEdit>(_AddressEdit);
export const AddressEdit = withInstall(_AddressEdit);
export default AddressEdit;
export { AddressEdit };
export type {
AddressEditInfo,
AddressEditInstance,

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _AddressList from './AddressList';
const AddressList = withInstall<typeof _AddressList>(_AddressList);
export const AddressList = withInstall(_AddressList);
export default AddressList;
export { AddressList };
export type { AddressListAddress } from './AddressListItem';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Area from './Area';
const Area = withInstall<typeof _Area>(_Area);
export const Area = withInstall(_Area);
export default Area;
export { Area };
export type { AreaList, AreaInstance, AreaColumnOption } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Badge from './Badge';
const Badge = withInstall<typeof _Badge>(_Badge);
export const Badge = withInstall(_Badge);
export default Badge;
export { Badge };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Button from './Button';
const Button = withInstall<typeof _Button>(_Button);
export const Button = withInstall(_Button);
export default Button;
export { Button };
export type { ButtonType, ButtonSize } from './Button';

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _Calendar from './Calendar';
const Calendar = withInstall<typeof _Calendar>(_Calendar);
export const Calendar = withInstall(_Calendar);
export default Calendar;
export { Calendar };
export type {
CalendarType,
CalendarDayItem,

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Card from './Card';
const Card = withInstall<typeof _Card>(_Card);
export const Card = withInstall(_Card);
export default Card;
export { Card };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Cascader from './Cascader';
const Cascader = withInstall<typeof _Cascader>(_Cascader);
export const Cascader = withInstall(_Cascader);
export default Cascader;
export { Cascader };
export type { CascaderOption, CascaderFieldNames } from './Cascader';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _CellGroup from './CellGroup';
const CellGroup = withInstall<typeof _CellGroup>(_CellGroup);
export const CellGroup = withInstall(_CellGroup);
export default CellGroup;
export { CellGroup };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Cell from './Cell';
const Cell = withInstall<typeof _Cell>(_Cell);
export const Cell = withInstall(_Cell);
export default Cell;
export { Cell };
export type { CellArrowDirection } from './Cell';

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _CheckboxGroup from './CheckboxGroup';
const CheckboxGroup = withInstall<typeof _CheckboxGroup>(_CheckboxGroup);
export const CheckboxGroup = withInstall(_CheckboxGroup);
export default CheckboxGroup;
export { CheckboxGroup };
export type {
CheckboxGroupInstance,
CheckboxGroupToggleAllOptions,

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Checkbox from './Checkbox';
const Checkbox = withInstall<typeof _Checkbox>(_Checkbox);
export const Checkbox = withInstall(_Checkbox);
export default Checkbox;
export { Checkbox };
export type { CheckboxInstance } from './types';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Circle from './Circle';
const Circle = withInstall<typeof _Circle>(_Circle);
export const Circle = withInstall(_Circle);
export default Circle;
export { Circle };
export type { CircleStartPosition } from './Circle';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Col from './Col';
const Col = withInstall<typeof _Col>(_Col);
export const Col = withInstall(_Col);
export default Col;
export { Col };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _CollapseItem from './CollapseItem';
const CollapseItem = withInstall<typeof _CollapseItem>(_CollapseItem);
export const CollapseItem = withInstall(_CollapseItem);
export default CollapseItem;
export { CollapseItem };
export type { CollapseItemInstance } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Collapse from './Collapse';
const Collapse = withInstall<typeof _Collapse>(_Collapse);
export const Collapse = withInstall(_Collapse);
export default Collapse;
export { Collapse };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _ConfigProvider from './ConfigProvider';
const ConfigProvider = withInstall<typeof _ConfigProvider>(_ConfigProvider);
export const ConfigProvider = withInstall(_ConfigProvider);
export default ConfigProvider;
export { ConfigProvider };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _ContactCard from './ContactCard';
const ContactCard = withInstall<typeof _ContactCard>(_ContactCard);
export const ContactCard = withInstall(_ContactCard);
export default ContactCard;
export { ContactCard };
export type { ContactCardType } from './ContactCard';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _ContactEdit from './ContactEdit';
const ContactEdit = withInstall<typeof _ContactEdit>(_ContactEdit);
export const ContactEdit = withInstall(_ContactEdit);
export default ContactEdit;
export { ContactEdit };
export type { ContactEditInfo } from './ContactEdit';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _ContactList from './ContactList';
const ContactList = withInstall<typeof _ContactList>(_ContactList);
export const ContactList = withInstall(_ContactList);
export default ContactList;
export { ContactList };
export type { ContactListItem } from './ContactList';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _CountDown from './CountDown';
const CountDown = withInstall<typeof _CountDown>(_CountDown);
export const CountDown = withInstall(_CountDown);
export default CountDown;
export { CountDown };
export type { CountDownInstance, CountDownCurrentTime } from './CountDown';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _CouponCell from './CouponCell';
const CouponCell = withInstall<typeof _CouponCell>(_CouponCell);
export const CouponCell = withInstall(_CouponCell);
export default CouponCell;
export { CouponCell };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _CouponList from './CouponList';
const CouponList = withInstall<typeof _CouponList>(_CouponList);
export const CouponList = withInstall(_CouponList);
export default CouponList;
export { CouponList };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Coupon from './Coupon';
const Coupon = withInstall<typeof _Coupon>(_Coupon);
export const Coupon = withInstall(_Coupon);
export default Coupon;
export { Coupon };
export type { CouponInfo } from './Coupon';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _DatetimePicker from './DatetimePicker';
const DatetimePicker = withInstall<typeof _DatetimePicker>(_DatetimePicker);
export const DatetimePicker = withInstall(_DatetimePicker);
export default DatetimePicker;
export { DatetimePicker };
export type { DatetimePickerType, DatetimePickerInstance } from './types';

View File

@ -120,11 +120,11 @@ Dialog.resetDefaultOptions = () => {
Dialog.currentOptions = extend({}, Dialog.defaultOptions);
};
Dialog.Component = withInstall(VanDialog);
Dialog.install = (app: App) => {
app.use(withInstall<typeof VanDialog>(VanDialog));
app.use(Dialog.Component);
app.config.globalProperties.$dialog = Dialog;
};
Dialog.Component = withInstall<typeof VanDialog>(VanDialog);
export { Dialog };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Divider from './Divider';
const Divider = withInstall<typeof _Divider>(_Divider);
export const Divider = withInstall(_Divider);
export default Divider;
export { Divider };
export type { DividerContentPosition } from './Divider';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _DropdownItem from './DropdownItem';
const DropdownItem = withInstall<typeof _DropdownItem>(_DropdownItem);
export const DropdownItem = withInstall(_DropdownItem);
export default DropdownItem;
export { DropdownItem };
export type { DropdownItemInstance, DropdownItemOption } from './types';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _DropdownMenu from './DropdownMenu';
const DropdownMenu = withInstall<typeof _DropdownMenu>(_DropdownMenu);
export const DropdownMenu = withInstall(_DropdownMenu);
export default DropdownMenu;
export { DropdownMenu };
export type { DropdownMenuDirection } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Empty from './Empty';
const Empty = withInstall<typeof _Empty>(_Empty);
export const Empty = withInstall(_Empty);
export default Empty;
export { Empty };

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _Field from './Field';
const Field = withInstall<typeof _Field>(_Field);
export const Field = withInstall(_Field);
export default Field;
export { Field };
export type {
FieldType,
FieldRule,

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Form from './Form';
const Form = withInstall<typeof _Form>(_Form);
export const Form = withInstall(_Form);
export default Form;
export { Form };
export type { FormInstance } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _GridItem from './GridItem';
const GridItem = withInstall<typeof _GridItem>(_GridItem);
export const GridItem = withInstall(_GridItem);
export default GridItem;
export { GridItem };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Grid from './Grid';
const Grid = withInstall<typeof _Grid>(_Grid);
export const Grid = withInstall(_Grid);
export default Grid;
export { Grid };
export type { GridDirection } from './Grid';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Icon from './Icon';
const Icon = withInstall<typeof _Icon>(_Icon);
export const Icon = withInstall(_Icon);
export default Icon;
export { Icon };

View File

@ -70,10 +70,10 @@ const ImagePreview = (
return instance;
};
ImagePreview.Component = withInstall<typeof VanImagePreview>(VanImagePreview);
ImagePreview.Component = withInstall(VanImagePreview);
ImagePreview.install = (app: App) => {
app.use(withInstall<typeof VanImagePreview>(VanImagePreview));
app.use(ImagePreview.Component);
};
export { ImagePreview };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Image from './Image';
const Image = withInstall<typeof _Image>(_Image);
export const Image = withInstall(_Image);
export default Image;
export { Image };
export type { ImageFit } from './Image';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _IndexAnchor from './IndexAnchor';
const IndexAnchor = withInstall<typeof _IndexAnchor>(_IndexAnchor);
export const IndexAnchor = withInstall(_IndexAnchor);
export default IndexAnchor;
export { IndexAnchor };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _IndexBar from './IndexBar';
const IndexBar = withInstall<typeof _IndexBar>(_IndexBar);
export const IndexBar = withInstall(_IndexBar);
export default IndexBar;
export { IndexBar };
export type { IndexBarInstance } from './types';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _List from './List';
const List = withInstall<typeof _List>(_List);
export const List = withInstall(_List);
export default List;
export { List };
export type { ListInstance, ListDirection } from './types';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Loading from './Loading';
const Loading = withInstall<typeof _Loading>(_Loading);
export const Loading = withInstall(_Loading);
export default Loading;
export { Loading };
export type { LoadingType } from './Loading';

View File

@ -10,7 +10,7 @@ const messages = reactive<Messages>({
'zh-CN': defaultMessages,
});
const Locale = {
export const Locale = {
messages(): Message {
return messages[lang.value];
},
@ -26,4 +26,3 @@ const Locale = {
};
export default Locale;
export { Locale };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _NavBar from './NavBar';
const NavBar = withInstall<typeof _NavBar>(_NavBar);
export const NavBar = withInstall(_NavBar);
export default NavBar;
export { NavBar };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _NoticeBar from './NoticeBar';
const NoticeBar = withInstall<typeof _NoticeBar>(_NoticeBar);
export const NoticeBar = withInstall(_NoticeBar);
export default NoticeBar;
export { NoticeBar };
export type { NoticeBarMode, NoticeBarInstance } from './types';

View File

@ -92,11 +92,11 @@ Notify.resetDefaultOptions = () => {
Notify.currentOptions = defaultOptions();
};
Notify.Component = withInstall(VanNotify);
Notify.install = (app: App) => {
app.use(withInstall<typeof VanNotify>(VanNotify));
app.use(Notify.Component);
app.config.globalProperties.$notify = Notify;
};
Notify.Component = withInstall<typeof VanNotify>(VanNotify);
export { Notify };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _NumberKeyboard from './NumberKeyboard';
const NumberKeyboard = withInstall<typeof _NumberKeyboard>(_NumberKeyboard);
export const NumberKeyboard = withInstall(_NumberKeyboard);
export default NumberKeyboard;
export { NumberKeyboard };
export type { NumberKeyboardTheme } from './NumberKeyboard';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Overlay from './Overlay';
const Overlay = withInstall<typeof _Overlay>(_Overlay);
export const Overlay = withInstall(_Overlay);
export default Overlay;
export { Overlay };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Pagination from './Pagination';
const Pagination = withInstall<typeof _Pagination>(_Pagination);
export const Pagination = withInstall(_Pagination);
export default Pagination;
export { Pagination };
export type { PaginationMode } from './Pagination';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _PasswordInput from './PasswordInput';
const PasswordInput = withInstall<typeof _PasswordInput>(_PasswordInput);
export const PasswordInput = withInstall(_PasswordInput);
export default PasswordInput;
export { PasswordInput };

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _Picker from './Picker';
const Picker = withInstall<typeof _Picker>(_Picker);
export const Picker = withInstall(_Picker);
export default Picker;
export { Picker };
export type {
PickerColumn,
PickerOption,

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _Popover from './Popover';
const Popover = withInstall<typeof _Popover>(_Popover);
export const Popover = withInstall(_Popover);
export default Popover;
export { Popover };
export type {
PopoverTheme,
PopoverAction,

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Popup from './Popup';
const Popup = withInstall<typeof _Popup>(_Popup);
export const Popup = withInstall(_Popup);
export default Popup;
export { Popup };
export type { PopupPosition, PopupCloseIconPosition } from './Popup';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Progress from './Progress';
const Progress = withInstall<typeof _Progress>(_Progress);
export const Progress = withInstall(_Progress);
export default Progress;
export { Progress };
export type { ProgressInstance } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _PullRefresh from './PullRefresh';
const PullRefresh = withInstall<typeof _PullRefresh>(_PullRefresh);
export const PullRefresh = withInstall(_PullRefresh);
export default PullRefresh;
export { PullRefresh };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _RadioGroup from './RadioGroup';
const RadioGroup = withInstall<typeof _RadioGroup>(_RadioGroup);
export const RadioGroup = withInstall(_RadioGroup);
export default RadioGroup;
export { RadioGroup };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Radio from './Radio';
const Radio = withInstall<typeof _Radio>(_Radio);
export const Radio = withInstall(_Radio);
export default Radio;
export { Radio };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Rate from './Rate';
const Rate = withInstall<typeof _Rate>(_Rate);
export const Rate = withInstall(_Rate);
export default Rate;
export { Rate };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Row from './Row';
const Row = withInstall<typeof _Row>(_Row);
export const Row = withInstall(_Row);
export default Row;
export { Row };
export type { RowAlign, RowJustify } from './Row';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Search from './Search';
const Search = withInstall<typeof _Search>(_Search);
export const Search = withInstall(_Search);
export default Search;
export { Search };
export type { SearchShape, SearchInstance } from './types';

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _ShareSheet from './ShareSheet';
const ShareSheet = withInstall<typeof _ShareSheet>(_ShareSheet);
export const ShareSheet = withInstall(_ShareSheet);
export default ShareSheet;
export { ShareSheet };
export type { ShareSheetOption, ShareSheetOptions } from './ShareSheet';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _SidebarItem from './SidebarItem';
const SidebarItem = withInstall<typeof _SidebarItem>(_SidebarItem);
export const SidebarItem = withInstall(_SidebarItem);
export default SidebarItem;
export { SidebarItem };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Sidebar from './Sidebar';
const Sidebar = withInstall<typeof _Sidebar>(_Sidebar);
export const Sidebar = withInstall(_Sidebar);
export default Sidebar;
export { Sidebar };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Skeleton from './Skeleton';
const Skeleton = withInstall<typeof _Skeleton>(_Skeleton);
export const Skeleton = withInstall(_Skeleton);
export default Skeleton;
export { Skeleton };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Slider from './Slider';
const Slider = withInstall<typeof _Slider>(_Slider);
export const Slider = withInstall(_Slider);
export default Slider;
export { Slider };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Step from './Step';
const Step = withInstall<typeof _Step>(_Step);
export const Step = withInstall(_Step);
export default Step;
export { Step };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Stepper, { StepperTheme } from './Stepper';
const Stepper = withInstall<typeof _Stepper>(_Stepper);
export const Stepper = withInstall(_Stepper);
export default Stepper;
export { Stepper };
export type { StepperTheme };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Steps from './Steps';
const Steps = withInstall<typeof _Steps>(_Steps);
export const Steps = withInstall(_Steps);
export default Steps;
export { Steps };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Sticky from './Sticky';
const Sticky = withInstall<typeof _Sticky>(_Sticky);
export const Sticky = withInstall(_Sticky);
export default Sticky;
export { Sticky };
export type { StickyPosition } from './Sticky';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _SubmitBar from './SubmitBar';
const SubmitBar = withInstall<typeof _SubmitBar>(_SubmitBar);
export const SubmitBar = withInstall(_SubmitBar);
export default SubmitBar;
export { SubmitBar };

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _SwipeCell from './SwipeCell';
const SwipeCell = withInstall<typeof _SwipeCell>(_SwipeCell);
export const SwipeCell = withInstall(_SwipeCell);
export default SwipeCell;
export { SwipeCell };
export type {
SwipeCellSide,
SwipeCellPosition,

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _SwipeItem from './SwipeItem';
const SwipeItem = withInstall<typeof _SwipeItem>(_SwipeItem);
export const SwipeItem = withInstall(_SwipeItem);
export default SwipeItem;
export { SwipeItem };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Swipe from './Swipe';
const Swipe = withInstall<typeof _Swipe>(_Swipe);
export const Swipe = withInstall(_Swipe);
export default Swipe;
export { Swipe };
export type { SwipeInstance, SwipeToOptions } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Switch from './Switch';
const Switch = withInstall<typeof _Switch>(_Switch);
export const Switch = withInstall(_Switch);
export default Switch;
export { Switch };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Tab from './Tab';
const Tab = withInstall<typeof _Tab>(_Tab);
export const Tab = withInstall(_Tab);
export default Tab;
export { Tab };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _TabbarItem from './TabbarItem';
const TabbarItem = withInstall<typeof _TabbarItem>(_TabbarItem);
export const TabbarItem = withInstall(_TabbarItem);
export default TabbarItem;
export { TabbarItem };

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Tabbar from './Tabbar';
const Tabbar = withInstall<typeof _Tabbar>(_Tabbar);
export const Tabbar = withInstall(_Tabbar);
export default Tabbar;
export { Tabbar };

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _Tabs from './Tabs';
const Tabs = withInstall<typeof _Tabs>(_Tabs);
export const Tabs = withInstall(_Tabs);
export default Tabs;
export { Tabs };
export type { TabsType, TabsInstance } from './types';

View File

@ -1,7 +1,5 @@
import { withInstall } from '../utils';
import _Tag from './Tag';
const Tag = withInstall<typeof _Tag>(_Tag);
export const Tag = withInstall(_Tag);
export default Tag;
export { Tag };

View File

@ -186,7 +186,7 @@ Toast.allowMultiple = (value = true) => {
};
Toast.install = (app: App) => {
app.use(withInstall<typeof VanToast>(VanToast));
app.use(withInstall(VanToast));
app.config.globalProperties.$toast = Toast;
};

View File

@ -1,8 +1,6 @@
import { withInstall } from '../utils';
import _TreeSelect from './TreeSelect';
const TreeSelect = withInstall<typeof _TreeSelect>(_TreeSelect);
export const TreeSelect = withInstall(_TreeSelect);
export default TreeSelect;
export { TreeSelect };
export type { TreeSelectItem, TreeSelectChild } from './TreeSelect';

View File

@ -1,10 +1,8 @@
import { withInstall } from '../utils';
import _Uploader from './Uploader';
const Uploader = withInstall<typeof _Uploader>(_Uploader);
export const Uploader = withInstall(_Uploader);
export default Uploader;
export { Uploader };
export type {
UploaderInstance,
UploaderResultType,

View File

@ -14,13 +14,12 @@ export type WithInstall<T> = T & {
install(app: App): void;
} & EventShim;
// using any here because tsc will generate some weird results when using generics
export function withInstall<T>(options: any): WithInstall<T> {
export function withInstall<T>(options: T) {
(options as Record<string, unknown>).install = (app: App) => {
const { name } = options as any;
app.component(name, options);
app.component(camelize(`-${name}`), options);
};
return options;
return options as WithInstall<T>;
}