question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to ignore template tag?

See original GitHub issue

What problem does this feature solve?

Is there the ability to ignore template tag? Example: I use standard vue component that contains own template and other logic. But in the same time on the page other template tag exists and vue tries to parse it… How to avoid it?

<div id="app">
    <template class="bla-bla">
        <div><h1></h1></div>
    </template>
    <my-component></my-component>
</div>

What does the proposed API look like?

<template v-ignore>...</template>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
stephantaborcommented, May 16, 2019

Here’s my use case which lead me to this issue

I’m using a web component in vue, since it’s allegedly compatible with web components

I have a template like this

<custom-element-table>
  <template>
    <thead>
      <!-- table head stuff-->
    </thead>
    <tbody>
      <!-- table body stuff-->
    </tbody>
  </template>
</custom-element-table>

from which i would expect DOM like this:

<custom-element-table>
  #shadow-root
  <template> <!-- in slot -->
    #document-fragment
      <thead>
        <!-- table head stuff-->
      </thead>
      <tbody>
        <!-- table body stuff-->
      </tbody>
  </template>
</custom-element-table>

but i get DOM like this, and a non functioning webcomponent:

<custom-element-table>
  #shadow-root
  <thead> <!-- in slot -->
    <!-- table head stuff-->
  </thead>
  <tbody>
    <!-- table body stuff-->
  </tbody>
</custom-element-table>

using v-pre on my custom element will render the template element as expected, but then i can’t use any directives, so that is not a usable approach

IMO, for the same reason I can’t make a vue component or custom element called div, Vue shouldn’t be using a standard html tag (<template>) like this and then not allowing a way to bail out of that.

0reactions
ukaaacommented, Oct 11, 2019

@stephantabor Too bad. I might look at creating my own template-like element or something. But it will never have the true benefits of a <template>, so I guess I could just make it any other element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

grunt-contrib-htmlmin how to ignore template tags
I'm using grunt-contrib-htmlmin to minify my html in a backbone/underscorejs project, however, when I run grunt-contrib-htmlmin on any ...
Read more >
Use JSDoc: @ignore
The @ignore tag indicates that a symbol in your code should never appear in the documentation. This tag takes precedence over all others....
Read more >
Exclude known template locations from tag counting
Ideally Obsidian would simply ignore known templates or whole template folders when counting tags. 13 Likes. Is it possible to ignore ...
Read more >
Liquid template language - Shopify Open Source
Template. Template tags tell Liquid where to disable processing for comments or non-Liquid markup, and how to establish relations among template files.
Read more >
Template Syntax | Vue.js
template <span>Message: {{ msg }}</span>. The mustache tag will be replaced ... the rawHtml property, interpreted as plain HTML - data bindings are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found