Skip to content

Prevent vue-cli templating from colliding with vue's own handlebar {{}} template markers #546

Closed
@bachi76

Description

@bachi76

As suggested by @LinusBorg in #284 (comment) I'll add this as feature request:

Problem: Currently, we cannot use vue-cli's templating feature with a bit larger template projects that contain many vue files, since both use handlebars and the delimiters collide: vue-cli will remove all vue {{}} tags unless \ is used everywhere, which is not reasonable in a larger template project.

Also, when working on the template project, vue will complain about missing data for the template strings used in vue-cli.

Idea: As with handlebars it's not possible to change the delimiters (handlebars-lang/handlebars.js#1184), the only solution seems to be to replace handlebars with e.g. mustache which allows custom delimiters (https://github.com/janl/mustache.js/#custom-delimiters) and works quite similar.

(I'm not sure if this is in scope, but certainly the collisions prevent some nice vue-cli template use-cases, in my case bootstrapping an IoT app which comes already with a basic set of features/vue components).

Activity

deleted a comment from micene09 on Sep 1, 2017
ggiotopoulos

ggiotopoulos commented on Nov 15, 2017

@ggiotopoulos

This is a very important feature. I work at a large biotech in Boston. We are attempting to implement Vue as a front end on a number of large single page applications here. We'd like our development team to have a nice default template to start with. Within that template we have some default data between {{}} that's very useful to demonstrate default functionality.

LinusBorg

LinusBorg commented on Nov 15, 2017

@LinusBorg
Member

Have you tried the skipInterpolation option?

ggiotopoulos

ggiotopoulos commented on Nov 15, 2017

@ggiotopoulos

no

DrSensor

DrSensor commented on Jan 7, 2018

@DrSensor

Using \{{ myData }} also works, although you need to add \ on every Vue handlebars.

added a commit that references this issue on Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @yyx990803@LinusBorg@bachi76@DrSensor@ggiotopoulos

        Issue actions

          Prevent vue-cli templating from colliding with vue's own handlebar {{}} template markers · Issue #546 · vuejs/vue-cli