press-ui
Version:
简单、易用的跨端组件库,兼容 Vue2 和 Vue3,同时支持 uni-app和普通 Vue 项目
21 lines (14 loc) • 539 B
JavaScript
import { getMPComponentHandler } from '../common/component-handler/mp-handler';
import { makeExtraMethods } from '../common/component-handler/component-handler';
import { initGlobalProps } from '../common/vue3/adapter';
import { DEFAULT_OPTIONS, DEFAULT_KEY } from './default-options';
const Toast = getMPComponentHandler({
defaultOptions: DEFAULT_OPTIONS,
name: 'press-toast',
});
makeExtraMethods(Toast, ['loading', 'success', 'fail'], DEFAULT_KEY);
initGlobalProps({
name: '$toast',
prop: Toast,
});
export default Toast;