K
K
kr_ilya2019-05-11 09:37:06
Vue.js
kr_ilya, 2019-05-11 09:37:06

How to render components from data()?

New to vue.
I'm trying to insert a tag from data

<v-list-tile
        v-for="(link, i) in links"
        :key="i"
        :to="link.to"
        :active-class="color"
        avatar
        class="v-list-item"
      >
        <v-list-tile-action>
          <icon-base icon-name="write">{{ link.icon }}</icon-base> //вот тут icon вставляется как текст
        </v-list-tile-action>
        <v-list-tile-title
          v-text="link.text"
        />
      </v-list-tile>

In to data()
links: [
      {
        icon: "<icon-write />",

I have <icon-write />
Inserted into the page as text, how do I make it render as a tag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sobolenko, 2019-05-11
@kr_ilya

You link.iconhave html. It should be displayed not in mustashe but in the v-html.

<v-list-tile-action>
    <icon-base icon-name="write" v-html="link.icon"></icon-base>
</v-list-tile-action>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question