Answer the question
In order to leave comments, you need to log in
Why is there an error when using the example from the vue documentation?
I want to add a copy of the component when the button is clicked.
Found an example in the documentation: https://v3.vuejs.org/guide/migration/global-api.ht...
const Profile = {
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>',
data() {
return {
firstName: 'Walter',
lastName: 'White',
alias: 'Heisenberg'
}
}
}
Vue.createApp(Profile).mount('#mount-point')
runtime-core.esm-bundler.js?5c40:6800 Uncaught TypeError: Cannot read properties of undefined (reading 'createApp')
at Proxy.addRequisites (transfers.vue?01d8:167:1)
at $data.step.Object.onClick._cache.<computed>._cache.<computed> (transfers.vue?01d8:45:1)
at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:6737:1)
at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?5c40:6746:1)
at HTMLDivElement.invoker (runtime-dom.esm-bundler.js?830f:357:1)
Answer the question
In order to leave comments, you need to log in
I copy it to the project and when I call the method on the button, I get in the console:
Found an example in the documentation. I copy it to the project
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<div id="mount-point"></div>
<script>
const Profile = {
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>',
data() {
return {
firstName: 'Walter',
lastName: 'White',
alias: 'Heisenberg'
}
}
}
Vue.createApp(Profile).mount('#mount-point')
</script>
</body>
</html>
What is it and why?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question