K
K
Kirill Ushakov2018-06-28 15:59:06
Vue.js
Kirill Ushakov, 2018-06-28 15:59:06

Vue.js escaping in v-for?

How to output data via v-for when it is presented like this:

{
  "0": {
    "link": {
      "#text": "http://..."
    } ,
    "media:content": {
      "@attr": "http://..."
    }
  }
}

When compiling, it swears at # : @
PS symbols. This structure is obtained after converting xml to json.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Ushakov, 2018-06-28
@Bellicus

Understood. Outputted in square brackets:

<div v-for="(item, index) in newsArray.item" :key="index">
    	<img :src="item['media:content']['@attr']" alt="">
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question