Answer the question
In order to leave comments, you need to log in
VueJS - how to properly make a modular component?
Greetings!
Through WebPack 4 + VueJS, I build the application and get an error.
Let's take a simple application example:
<template>
<div id="hello" class="class_123">
<h2>{{message}}</h2>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
message: 'Welcome to Vue.js'
}
}
}
</script>
<style>
.class_123 {
font-family: Verdana;
color: navy;
}
</style>
<template src="./modal.html"></template>
<style src="./modal.css"></style>
<script src="./modal.js"></script>
export default {
name: 'app',
data () {
return {
message: 'Welcome to Vue.js'
}
}
}
.class_123 {
font-family: Verdana;
color: navy;
}
<div id="app" class="class_123">
<h2>{{message}}</h2>
</div>
<template>
<div id="app" class="class_123">
<h2>{{message}}</h2>
</div>
</template>
<style src="./modal.css"></style>
<script src="./modal.js"></script>
<template>
is in a separate file? Answer the question
In order to leave comments, you need to log in
try
<template src="./modal.html" lang="html"></template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question