Compare commits

...

8 Commits

Author SHA1 Message Date
chenjiahan
ba3e6d56a0 perf: reduce bundle size 2021-04-06 20:40:05 +08:00
chenjiahan
93e3ee03f5 chore: release @vant/popperjs 1.1.0 2021-04-06 20:31:26 +08:00
chenjiahan
0d132337d5 feat(@vant/popperjs): bump @popperjs/core@2.9.2 2021-04-06 20:30:45 +08:00
chenjiahan
8e51113c04 chore: release @vant/lazyload 1.1.0 2021-04-06 20:13:18 +08:00
chenjiahan
39cb0b461e build: extract .browserslistrc 2021-04-06 20:10:20 +08:00
chenjiahan
0b60b553c4 docs(@vant/use): changelog v1.1.0 2021-04-06 20:05:59 +08:00
chenjiahan
d349ee4a80 chore: release @vant/use@1.1.0 2021-04-06 20:04:22 +08:00
neverland
ace4c9b60b
chore(@vant/use): fix some lint issues (#8462) 2021-04-06 20:03:26 +08:00
16 changed files with 70 additions and 77 deletions

2
.browserslistrc Normal file
View File

@ -0,0 +1,2 @@
Chrome >= 51
iOS >= 10

View File

@ -52,9 +52,9 @@
"dependencies": {
"@babel/runtime": "7.x",
"@vant/icons": "^1.5.3",
"@vant/lazyload": "^1.0.4",
"@vant/popperjs": "^1.0.4",
"@vant/use": "^1.0.5"
"@vant/lazyload": "^1.1.0",
"@vant/popperjs": "^1.1.0",
"@vant/use": "^1.1.0"
},
"peerDependencies": {
"vue": "^3.0.0"
@ -75,9 +75,5 @@
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"web-types": "vetur/web-types.json",
"browserslist": [
"Chrome >= 51",
"iOS >= 10"
]
"web-types": "vetur/web-types.json"
}

View File

@ -1,6 +1,6 @@
{
"name": "@vant/lazyload",
"version": "1.0.3",
"version": "1.1.0",
"description": "This is a fork of vue-lazyload",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
@ -27,10 +27,6 @@
"release-it": "^14.2.2",
"vue": "^3.0.0"
},
"browserslist": [
"Android >= 4.0",
"iOS >= 8"
],
"release-it": {
"git": {
"tag": false,

View File

@ -1,6 +1,6 @@
{
"name": "@vant/popperjs",
"version": "1.0.4",
"version": "1.1.0",
"description": "Precompiled popperjs core",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
@ -20,7 +20,7 @@
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-popperjs",
"dependencies": {
"@popperjs/core": "^2.5.4"
"@popperjs/core": "^2.9.2"
},
"devDependencies": {
"@babel/runtime": "7.x",
@ -29,10 +29,6 @@
"release-it": "^14.2.2",
"rollup": "^2.33.3"
},
"browserslist": [
"Android >= 4.0",
"iOS >= 8"
],
"release-it": {
"git": {
"tag": false,

View File

@ -182,10 +182,10 @@
"@octokit/openapi-types" "^2.0.0"
"@types/node" ">= 8"
"@popperjs/core@^2.5.4":
version "2.5.4"
resolved "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.5.4.tgz?cache=0&sync_timestamp=1604076368519&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40popperjs%2Fcore%2Fdownload%2F%40popperjs%2Fcore-2.5.4.tgz#de25b5da9f727985a3757fd59b5d028aba75841a"
integrity sha1-3iW12p9yeYWjdX/Vm10Cirp1hBo=
"@popperjs/core@^2.9.2":
version "2.9.2"
resolved "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353"
integrity sha1-rep7aVPLs0ZRdmsFSEaOdDxqI1M=
"@rollup/plugin-babel@^5.2.1":
version "5.2.1"

View File

@ -1,5 +1,11 @@
# 更新日志
### v1.1.0
`2021-04-06`
- 构建结果由 ES5 调整为 ES6
### v1.0.5
`2021-02-13`

View File

@ -1,6 +1,6 @@
{
"name": "@vant/use",
"version": "1.0.5",
"version": "1.1.0",
"description": "Vant Composition API",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",

View File

@ -59,15 +59,15 @@ export default {
### 类型定义
```ts
type Options = {
eventName?: string;
};
function useClickAway(
target: Element | Ref<Element | undefined>,
listener: EventListener,
options?: Options
): void;
type Options = {
eventName?: string;
};
```
### 参数

View File

@ -62,13 +62,13 @@ export default {
### 类型定义
```ts
function useCountDown(options: UseCountDownOptions): CountDown;
type UseCountDownOptions = {
time: number;
millisecond?: boolean;
onChange?: (current: CurrentTime) => void;
onFinish?: () => void;
type CurrentTime = {
days: number;
hours: number;
total: number;
minutes: number;
seconds: number;
milliseconds: number;
};
type CountDown = {
@ -78,14 +78,14 @@ type CountDown = {
current: ComputedRef<CurrentTime>;
};
type CurrentTime = {
days: number;
hours: number;
total: number;
minutes: number;
seconds: number;
milliseconds: number;
type UseCountDownOptions = {
time: number;
millisecond?: boolean;
onChange?: (current: CurrentTime) => void;
onFinish?: () => void;
};
function useCountDown(options: UseCountDownOptions): CountDown;
```
### 参数

View File

@ -33,17 +33,17 @@ export default {
## 类型定义
```ts
function useEventListener(
type: string,
listener: EventListener,
options?: Options
): void;
type Options = {
target?: EventTarget | Ref<EventTarget>;
capture?: boolean;
passive?: boolean;
};
function useEventListener(
type: string,
listener: EventListener,
options?: Options
): void;
```
## API

View File

@ -26,9 +26,9 @@ export default {
### 类型定义
```ts
function usePageVisibility(): Ref<VisibilityState>;
type VisibilityState = 'visible' | 'hidden';
function usePageVisibility(): Ref<VisibilityState>;
```
### 返回值

View File

@ -31,7 +31,9 @@ export default {
### 类型定义
```ts
function useRect((Element | Window) | Ref<Element | Window | undefined>): DOMRect;
function useRect(
element: Element | Window | Ref<Element | Window | undefined>
): DOMRect;
```
### 返回值

View File

@ -16,9 +16,9 @@ function makeDOMRect(width: number, height: number) {
}
export const useRect = (
elementRef: (Element | Window) | Ref<Element | Window | undefined>
elementOrRef: Element | Window | Ref<Element | Window | undefined>
) => {
const element = unref(elementRef);
const element = unref(elementOrRef);
if (isWindow(element)) {
const width = element.innerWidth;

View File

@ -23,10 +23,7 @@ export function useParent<T>(key: string | symbol) {
const { link, unlink, internalChildren, ...rest } = parent;
link(instance);
onUnmounted(() => {
unlink(instance);
});
onUnmounted(() => unlink(instance));
const index = computed(() => internalChildren.indexOf(instance));

View File

@ -24,7 +24,5 @@ export function cancelRaf(id: number) {
// double raf for animation
export function doubleRaf(fn: FrameRequestCallback): void {
raf(() => {
raf(fn);
});
raf(() => raf(fn));
}

View File

@ -1378,10 +1378,10 @@
dependencies:
"@types/node" ">= 8"
"@popperjs/core@^2.5.4":
version "2.5.4"
resolved "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.5.4.tgz#de25b5da9f727985a3757fd59b5d028aba75841a"
integrity sha1-3iW12p9yeYWjdX/Vm10Cirp1hBo=
"@popperjs/core@^2.9.2":
version "2.9.2"
resolved "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353"
integrity sha1-rep7aVPLs0ZRdmsFSEaOdDxqI1M=
"@sindresorhus/is@^0.14.0":
version "0.14.0"
@ -1939,10 +1939,10 @@
resolved "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.5.3.tgz?cache=0&sync_timestamp=1613997305954&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Ficons%2Fdownload%2F%40vant%2Ficons-1.5.3.tgz#b7779f67bf608d417a82452fbede406dfa46b439"
integrity sha1-t3efZ79gjUF6gkUvvt5AbfpGtDk=
"@vant/lazyload@^1.0.4":
version "1.0.4"
resolved "https://registry.npm.taobao.org/@vant/lazyload/download/@vant/lazyload-1.0.4.tgz?cache=0&sync_timestamp=1615084239650&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Flazyload%2Fdownload%2F%40vant%2Flazyload-1.0.4.tgz#f1bbd81217cf416a377ab2f928f2a147a4489259"
integrity sha1-8bvYEhfPQWo3erL5KPKhR6RIklk=
"@vant/lazyload@^1.1.0":
version "1.1.0"
resolved "https://registry.npm.taobao.org/@vant/lazyload/download/@vant/lazyload-1.1.0.tgz#9b742df97e6a119d4e2bc9096d6b9a5570d4c10c"
integrity sha1-m3Qt+X5qEZ1OK8kJbWuaVXDUwQw=
"@vant/markdown-loader@^4.1.0":
version "4.1.0"
@ -1964,12 +1964,12 @@
fast-glob "^3.2.2"
fs-extra "^9.0.0"
"@vant/popperjs@^1.0.4":
version "1.0.4"
resolved "https://registry.npm.taobao.org/@vant/popperjs/download/@vant/popperjs-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fpopperjs%2Fdownload%2F%40vant%2Fpopperjs-1.0.4.tgz#49c20809a3828e7b036e23d50fb56121e997618f"
integrity sha1-ScIICaOCjnsDbiPVD7VhIemXYY8=
"@vant/popperjs@^1.1.0":
version "1.1.0"
resolved "https://registry.npm.taobao.org/@vant/popperjs/download/@vant/popperjs-1.1.0.tgz?cache=0&sync_timestamp=1617712476713&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fpopperjs%2Fdownload%2F%40vant%2Fpopperjs-1.1.0.tgz#b4edee5bbfa6fb18705986e313d4fd5f17942a0f"
integrity sha1-tO3uW7+m+xhwWYbjE9T9XxeUKg8=
dependencies:
"@popperjs/core" "^2.5.4"
"@popperjs/core" "^2.9.2"
"@vant/stylelint-config@^1.4.2":
version "1.4.2"
@ -1984,10 +1984,10 @@
resolved "https://registry.yarnpkg.com/@vant/touch-emulator/-/touch-emulator-1.2.0.tgz#486300b23e57db9ce9231a04e0a0c621c68692d8"
integrity sha512-sJ97zU85zOq51qoi7+CpBEcOyH3CitjP1KC7/GQwqaurUJni+EP7/F9n0HMnAh8GXMjgtgDBNJ5z48x+coNKYQ==
"@vant/use@^1.0.5":
version "1.0.5"
resolved "https://registry.npm.taobao.org/@vant/use/download/@vant/use-1.0.5.tgz#44bee952ebccf9396414a51c4d4b458434a9de23"
integrity sha1-RL7pUuvM+TlkFKUcTUtFhDSp3iM=
"@vant/use@^1.1.0":
version "1.1.0"
resolved "https://registry.npm.taobao.org/@vant/use/download/@vant/use-1.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fuse%2Fdownload%2F%40vant%2Fuse-1.1.0.tgz#f38f765db36401699310d75d323440e5d8f42674"
integrity sha1-8492XbNkAWmTENddMjRA5dj0JnQ=
dependencies:
"@babel/runtime" "7.x"