Skip to content

Commit

Permalink
chore: update format, typo (#2641)
Browse files Browse the repository at this point in the history
Co-authored-by: Haotian Zhang <haotian.zhang@shopee.com>
  • Loading branch information
hawtim and Haotian Zhang committed Jan 11, 2023
1 parent 8a56b51 commit cb80b93
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"cSpell.words": [
"Axios",
"consola",
"Demi",
"Unsubscribable",
"esno",
"iframes",
"iife",
"Pausable",
"Unref",
"Unsubscribable",
"vitepress",
"vueuse"
],
"prettier.enable": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useIdle/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const idledFor = computed(() =>

<template>
<note class="mb-2">
For demonstraction purpose, the idle timeout is set to <b>5s</b> in this
For demonstration purpose, the idle timeout is set to <b>5s</b> in this
demo (default 1min).
</note>
<div class="mb-2">
Expand Down
5 changes: 2 additions & 3 deletions packages/core/useInfiniteScroll/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ category: Sensors

# useInfiniteScroll

Infinite scrolling of the element.
Infinite scrolling of the element.

## Usage


```html
<script setup lang="ts">
import { ref, toRefs } from 'vue'
import { useInfiniteScroll } from '@vueuse/core'
const el = ref<HTMLElement>(null)
const data = ref([1,2,3,4,5,6])
const data = ref([1, 2, 3, 4, 5, 6])
useInfiniteScroll(
el,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useWebWorkerFn/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const workerSort = async () => {
<template>
<p>Current Time: <b>{{ computedTime }}</b></p>
<note class="mb-2">
This is a demo showing sort for large array (5 milion numbers) with or w/o WebWorker.<br>Clock stops when UI blocking happens.
This is a demo showing sort for large array (5 million numbers) with or w/o WebWorker.<br>Clock stops when UI blocking happens.
</note>
<button @click="baseSort">
Sort in Main Thread
</button>
<button v-if="!running" @click="workerSort">
Sort in Worker
</button>
<button v-else class="orange" @click="workerTerminate">
<button v-else class="orange" @click="workerTerminate('PENDING')">
Terminate Worker
</button>
<p v-if="data">
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useWebWorkerFn/lib/depsParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Concatenates the dependencies into a comma separated string.
* this string will then be passed as an argument to the "importScripts" function
*
* @param {Array.<String>}} deps array of string
* @param {Array.<String>} deps array of string
* @returns {String} a string composed by the concatenation of the array
* elements "deps" and "importScripts".
*
Expand Down
16 changes: 11 additions & 5 deletions packages/integrations/useAsyncValidator/demo.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const { pass, isFinished, errorFields } = useAsyncValidator(form, rules)
<div>
email:
<input
v-model="form.email" :class="{ '!border-red': errorFields?.email?.length }" type="text"
v-model="form.email"
:class="{ '!border-red': errorFields?.email?.length }"
type="text"
placeholder="email"
>
<div v-if="errorFields?.email?.length" text-red>
Expand All @@ -50,20 +52,24 @@ const { pass, isFinished, errorFields } = useAsyncValidator(form, rules)
<div>
name:
<input
v-model="form.name" :class="{ '!border-red': errorFields?.name?.length }" type="text"
v-model="form.name"
:class="{ '!border-red': errorFields?.name?.length }"
type="text"
placeholder="name"
>
<div v-if=" errorFields?.name?.length" text-red>
<div v-if="errorFields?.name?.length" text-red>
{{ errorFields.name[0].message }}
</div>
</div>
<div>
age:
<input
v-model="form.age" :class="{ '!border-red': errorFields?.age?.length }" type="number"
v-model="form.age"
:class="{ '!border-red': errorFields?.age?.length }"
type="number"
placeholder="age"
>
<div v-if=" errorFields?.age?.length" text-red>
<div v-if="errorFields?.age?.length" text-red>
{{ errorFields.age[0].message }}
</div>
</div>
Expand Down

0 comments on commit cb80b93

Please sign in to comment.