Skip to content

Commit

Permalink
docs: fix demo styles (vitest-dev#746)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: patak <matias.capeletto@gmail.com>
  • Loading branch information
3 people committed Sep 15, 2021
1 parent 9a45b9b commit e7486d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions packages/.vitepress/theme/styles/demo.css
Expand Up @@ -105,6 +105,18 @@
background: var(--c-bg);
color: var(--c-text);
}
input[type='number'] {
display: block;
min-width: 15rem;
font-size: 1.05rem;
padding: 0.5em 1em 0.4em 1em;
border: 1px solid var(--c-divider-light);
border-radius: 4px;
margin: 0.5rem 0;
outline: none;
background: var(--c-bg);
color: var(--c-text);
}

input:focus {
border: 1px solid var(--c-divider-dark);
Expand Down
5 changes: 4 additions & 1 deletion packages/core/useDebouncedRefHistory/demo.vue
Expand Up @@ -9,7 +9,9 @@ const format = (ts: number) => dayjs(ts).format()
const delay: Ref<number> = ref(1000)
const { count, inc, dec } = useCounter()
const { history, undo, redo, canUndo, canRedo } = useDebouncedRefHistory(count, { capacity: 10, debounce: delay })
const { history, undo, redo, canUndo, canRedo } = useDebouncedRefHistory(
count, { capacity: 10, debounce: delay },
)
</script>

<template>
Expand All @@ -27,6 +29,7 @@ const { history, undo, redo, canUndo, canRedo } = useDebouncedRefHistory(count,
<button :disabled="!canRedo" @click="redo()">
Redo
</button>
<br />
<span>Delay (in ms):</span>
<input v-model="delay" type="number" />
<br>
Expand Down
6 changes: 5 additions & 1 deletion packages/core/useThrottledRefHistory/demo.vue
Expand Up @@ -9,7 +9,10 @@ const format = (ts: number) => dayjs(ts).format()
const delay: Ref<number> = ref(1000)
const { count, inc, dec } = useCounter()
const { history, undo, redo, canUndo, canRedo } = useThrottledRefHistory(count, { deep: true, throttle: delay })
const { history, undo, redo, canUndo, canRedo } = useThrottledRefHistory(
count, {
deep: true, throttle: delay, capacity: 10,
})
</script>

<template>
Expand All @@ -27,6 +30,7 @@ const { history, undo, redo, canUndo, canRedo } = useThrottledRefHistory(count,
<button :disabled="!canRedo" @click="redo()">
Redo
</button>
<br />
<span>Delay (in ms):</span>
<input v-model="delay" type="number" />
<br>
Expand Down

0 comments on commit e7486d3

Please sign in to comment.