0

a thing like this won't be correctly parsed. {{ item.post_permalink }} will not be substituted by the passed-in text, while {{ item.read_label }} will be correctly parsed.

<script type="text/x-template" id="news-template">
   <a href="{{ item.post_permalink }}" class="read-more">{{ item.read_label }}</a>
</script>

how to solve? It seem's it's somewhat related about being inside an html property

Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118

1 Answers1

1

You should use v-bind to dynamically bind the attribute values not {{ }}

So do it like this:

   <script type="text/x-template" id="news-template">
       <a v-bind:href="item.post_permalink" class="read-more">{{ item.read_label }}</a>
    </script>

or shorthand for v-bind is : like this:

   <script type="text/x-template" id="news-template">
       <a :href="item.post_permalink" class="read-more">{{ item.read_label }}</a>
    </script>
Vamsi Krishna
  • 30,568
  • 8
  • 70
  • 78