Created
June 24, 2017 04:06
-
-
Save movii/b6be22950224871840133a0537765994 to your computer and use it in GitHub Desktop.
Vue.js Dynamically Compile <router-link />: 3. demo - 2 component <dynametic-link>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('dynamic-link', { | |
template: '<component v-bind:is="transformed"/>', | |
data () { | |
return { | |
text: '<router-link to="/foo">Go to Foo</router-link>' | |
} | |
}, | |
computed: { | |
transformed () { | |
return { template: this.text } | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment