Skip to content

Add verbatim Feature to allow AdonisJS template engine to escape conflicting syntax #3072

@hamzabawumia

Description

@hamzabawumia

When i use AdonisJS with VueJS, there seems to be some conflict with the mustache {{ }} syntax.
Frameworks like Django have a tag called {% Verbatim %} that can be used to surround conflicting mustache syntax so the template engine does not render that part of the code.
I wish you will add such a feature to Adonis. The below code works fine outside Adonis when published as a .html file. But it does not work in Adonis - the drop down list shows as "undefined".

<html>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>

<div id="app">

<form action="/" method="POST">
 
    <select v-model="Selected">
        <option v-for="item in test" v-bind:value="item.name" >
            {{ item.name }}
        </option>
    </select>

    <input type="submit" value="Submit" class="btn btn-primary">
  </form> 

</div> 

<script>

        new Vue({
        
                el: '#app',
        
                data: {



                    test: [
                            { id:1, name:"adam"},
                            { id:2, name:"lena"},
                            { id:3, name:"hamza"},
                    ],

                    Selected: "",
    
                },
                    
                
        })
        
    </script>
 
</body>
</html>

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