Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to mount component when including a component from another #31

Closed
asfernandes opened this issue Jan 9, 2017 · 1 comment
Closed

Comments

@asfernandes
Copy link

I found no example that a component template includes another component in a .vue file.

The error I have is: Failed to mount component: template or render function not defined.
(found in component )

app.vue:

<template>
<div id="app">
	<comp></comp>
</div>
</template>

<script>
import { Vue, Component } from 'av-ts';
import * as Comp from './comp.vue';

@Component({
	components: { 'comp': Comp }
})
class App extends Vue
{
}

export default App;
</script>

<style>
</style>

comp.vue:

<template>
<div id="comp">
	<div>
		Comp
	</div>
</div>
</template>

<script>
import { Vue, Component } from 'av-ts';

@Component(/*{
	name: 'comp'
}*/)
class Comp extends Vue
{
}

export default Comp;
</script>

<style>
</style>

app.ts:

import * as Vue from 'vue';
import Comp from './comp.vue';
import App from './app.vue';


new Vue({
	el: '#app',
	components: { App, Comp },
	render: h => h('app')
});

I can include comp directly in app.ts, but it does not work when embedded in app.vue component.

@asfernandes
Copy link
Author

Sorry, some intellisense fault caused I changed the import in app.vue.

The correct is:

import Comp from './comp.vue';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant