Make sure to include the latest vue js file
To access the source, visit https://unpkg.com/[email protected]/dist/vue.global.js and include it in your project
I removed some parts (axios, methods, template, etc.) but this should help you understand.
Key points to note...
- utilize
createApp
from Vue by either using Vue.createApp
or destructuring
data
must be a function that returns an object
Example:
const app = Vue.createApp({
el: '#app',
delimiters: ['[[', ']]'],
data() {
return {
returned_task: '',
new_task: '',
create_modify: '',
modify_id: -1,
modify_index: -1,
tasks: []
}
},
created() {
this.tasks = ['do this 🐱🐉', 'and that 🤳'];
},
});
app.mount('#app')
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4036352500736e706e706d32236e75">[email protected]</a>/dist/vue.global.prod.js"></script>
<div id="app">
<ul>
<li v-for="task in tasks">[[task]]</li>
</ul>
</div>