Skip to content

Commit 9153dd3

Browse files
authored
fix: allow at to be 0 in <v-clicks> (#2081)
1 parent bb46180 commit 9153dd3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

packages/client/builtin/VClicks.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ export default defineComponent({
4343
const every = +this.every
4444
const at = normalizeSingleAtValue(this.at)
4545
const isRelative = typeof at === 'string'
46-
if (!at) {
47-
console.warn('[slidev] Invalid at prop for v-clicks component:', at)
48-
return
46+
47+
let elements = this.$slots.default?.()
48+
49+
if (at == null || !elements) {
50+
return elements
4951
}
5052

5153
const click = resolveDirective('click')!
@@ -71,11 +73,6 @@ export default defineComponent({
7173
}) as T
7274
}
7375

74-
let elements = this.$slots.default?.()
75-
76-
if (!elements)
77-
return
78-
7976
elements = openAllTopLevelSlots(toArray(elements))
8077

8178
const mapSubList = (children: VNodeArrayChildren, depth = 1): VNodeArrayChildren => {

0 commit comments

Comments
 (0)