Although the code is functioning properly, I am interested in storing my component outside of the HTML and then importing it. My preference would be to have it in a dedicated component folder. Is this feasible?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test</title>
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
</head>
<body>
<div id="app">
<test />
</div>
<script>
const component1 = {
template: `<div> <p>{{ item }}</p></div>`,
props: ['prop'],
data: () => ({ item: 'test' }),
}
const app = Vue.createApp({
data: () => ({ someData: 'prop' }),
})
app.component('test', component1)
app.mount('#app')
</script>
</body>
</html>