0👍
Your markup inside the script
tag is wrong. To create a template, you’d have to export the script
, like so:
<template>
<div class="MyTemplate">
Your template
</div>
</template>
<script>
export default {
name: "MyTemplate"
}
</script>
To then use the template, just import it (import MyTemplate from './MyTemplate.vue'
) and add it to your components (components: { MyTemplate }
) then place it in as <myTemplate>
)
Source:stackexchange.com