0

example:

<div id="app">
  {{ message }}
</div>
var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  }
})

How can I print source code '{{message}}' not 'Hello Vue!'

1
  • what you have tried? Commented Aug 1, 2017 at 5:44

1 Answer 1

2

One option is to use html symbol codes instead of { and }.

{ = &#123;
} = &#125;  

---

{{ message }} 

&#123;&#123; message &#125;&#125;

Or you can use v-text attribute:

<div v-text="'{{message}}'">
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.