3

I'm trying to use Vuejs with some plugins.

There are two components

Vue.component('element-one', {
  template: '<h1>Element ONE</h1>',
}

And the second one :

Vue.component('element-two', {
  template: '<h1>Element TWO</h1>',
}

I want to be able to display the compiled version of element-one in element-two, I know there is something like:

var element = Vue.component('element-one');
new element().$mount().$appendTo('body');

But I'd love to have just the 'mounted' version, and not append it to any place.

Something I can play with in console.log ??

0

1 Answer 1

2

I received an answer from https://gitter.im/vuejs/vue. You can get the element by

new element().$mount().$el
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.