Skip to content

Configuration for empty VNode not to render to <!----> #5117

Closed
@xtongs

Description

@xtongs

I have been working on an infinite scroll list plugin for Vue.js 2.1+.
It basically use 'v-if' to implement DOM recycling, meaning that when the list gets long enough,
there will still only be limited DOMs exists so that scrolling performance remains good.

The idea comes from this article Complexities of an Infinite Scroller,
I found it will be useful if the idea can be implemented with Vue, so there comes out this plugin.

So far it works pretty well, with scoped slots, it's highly customizable.
But there is this tiny problem, empty VNode will be rendered to this <!----> html comment string.
This is definitely not a bug, and I found the empty comment string is used for Vue unit test.

However, when developing and inspecting elements, the developer tools panel is full of <!---->s.
image
Check out the repo and example page.

It seems have no influence on performance, only a little annoying to developers.
So is there any way to get rid of these empty comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions