chore: expose utils in entry file
This commit is contained in:
@@ -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,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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -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() {}
|
||||
|
||||
Reference in New Issue
Block a user