Answer the question
In order to leave comments, you need to log in
Why doesn't the v-html directive work?
I want to display the svg markup of the icon inside the block created in the component, to which I deliver this icon via props.
<script>
var Vue = require("vue/dist/vue.js");
vHeader = Vue.component("vheader", {
props: ['icons'],
created: function(){
console.log(this.$props);
}
});
module.exports = vHeader;
</script>
<template>
<header class='header'>
<div class='plate row row--center-y row--between-x'>
<div class='header__logo' v-html='icons.projectMenu'></div>
</div>
</header>
</template>
Vue = require "vue/dist/vue.js"
axios = require 'axios'
class VueEntry
init: ->
new Vue
el: "#vhead"
data: ->
return "icons": {}
components:
"vheader": require("./header/header.vue")
created: ->
that = this
axios.get('/jsondata/etc/icons.json')
.then (resp) ->
Object.assign that.$data.icons, resp.data
.catch (err) ->
console.log err
module.exports = VueEntry
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question