chore: expose utils in entry file

This commit is contained in:
chenjiahan
2020-09-27 17:11:43 +08:00
parent da0d5435de
commit 0072f4fe02
33 changed files with 120 additions and 105 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
/**
* Create a basic component with common options
*/
import { camelize } from '../format/string';
import { App, defineComponent, ComponentOptionsWithObjectProps } from 'vue';
import { camelize } from '..';
export function createComponent(name: string) {
return function (sfc: ComponentOptionsWithObjectProps) {
+1 -2
View File
@@ -1,5 +1,4 @@
import { get, isFunction } from '..';
import { camelize } from '../format/string';
import { get, camelize, isFunction } from '..';
import locale from '../../locale';
export function createI18N(name: string) {
-15
View File
@@ -1,15 +0,0 @@
/**
* Hack for iOS12 page scroll
* https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
*/
import { isIOS as checkIsIOS } from '../validate/system';
import { getRootScrollTop, setRootScrollTop } from './scroll';
const isIOS = checkIsIOS();
export function resetScroll() {
if (isIOS) {
setRootScrollTop(getRootScrollTop());
}
}
+12
View File
@@ -1,3 +1,5 @@
import { isIOS as checkIsIOS } from '../validate/system';
type ScrollElement = HTMLElement | Window;
function isWindow(val: unknown): val is Window {
@@ -56,3 +58,13 @@ export function getVisibleTop(el: ScrollElement) {
}
return el.getBoundingClientRect().top;
}
const isIOS = checkIsIOS();
// hack for iOS12 page scroll
// see: https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
export function resetScroll() {
if (isIOS) {
setRootScrollTop(getRootScrollTop());
}
}
+8 -2
View File
@@ -1,5 +1,11 @@
export { addUnit, getSizeStyle } from './format/unit';
export { createNamespace } from './create';
export * from './create';
export * from './format/unit';
export * from './format/number';
export * from './format/string';
export * from './dom/raf';
export * from './dom/style';
export * from './dom/event';
export * from './dom/scroll';
// eslint-disable-next-line @typescript-eslint/no-empty-function
export function noop() {}