0

I'm trying to make a simple vue component work:

<div id="app">
  <my-component></my-component>
</div>

<script>
  Vue.component('my-component', {
    template: '<div>A custom component! {{ xstr }} aa</div>',
    data: function() {
      return {
        xstr: 'i really want this to be visible',
      };
    }
  });

  window.app = new Vue({
    el: '#app',
  });
</script>

But apparently xstr is not displayed. What am I missing?

2
  • This code works, create non-working demo. Commented Jan 9, 2018 at 13:51
  • It doesn't work for me. Which version are you using? Commented Jan 9, 2018 at 13:57

1 Answer 1

0

I identified my issue, but it's not related to vue. I used jinja2 for generating the html, and since jinja uses the {{ }} syntax for templating as well, the two systems interfered.

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.