-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Click handler on element with v-lazy-show (#12)
- Loading branch information
Showing
6 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<span v-lazy-show="foo" @click="handle" :id="id" class="111"> | ||
Hello | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, vShow as _vShow, withDirectives as _withDirectives } from "vue" | ||
|
||
export function render(_ctx, _cache) { | ||
return (_cache._lazyshow1 || _ctx.foo) | ||
? (_cache._lazyshow1 = true, (_openBlock(), _createElementBlock(_Fragment, null, [ | ||
_withDirectives(_createElementVNode("span", { | ||
onClick: _cache[1] || (_cache[1] = $event => (_ctx._ctx.handle && _ctx.handle(...args))), | ||
id: _ctx.id, | ||
class: "111" | ||
}, " Hello ", 8 /* PROPS */, ["id"]), [ | ||
[_vShow, _ctx.foo] | ||
]) | ||
], 64))) | ||
: _createCommentVNode("v-show-if", true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue" | ||
import { ssrRenderAttrs as _ssrRenderAttrs } from "vue/server-renderer" | ||
|
||
export function ssrRender(_ctx, _push, _parent, _attrs) { | ||
if (_ctx.foo) { | ||
_push(`<span${_ssrRenderAttrs(_mergeProps({ | ||
id: _ctx.id, | ||
class: "111" | ||
}, _attrs, _attrs))}> Hello </span>`) | ||
} else { | ||
_push(`<!---->`) | ||
} | ||
} |