<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/vue@2"></script>
<title>Vujs</title>
</head>
<body>
<div id="app">
<div v-for="toto in todos">
{{toto.text}}
</div>
</div>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
new Vue({
el: "#app",
data: {
todos: [
{text: 'Học 1'},
{text: 'Học 2'},
{text: 'Học 3'}
]
},
methods: {
conthem: function() {
return this.inputValue +=1;
}
},
});
<script src="https://unpkg.com/vue@3"></script>
<div id="app">{{ message }}</div>
<script>
Vue.createApp({
data() {
return {
message: 'Hello Vue!'
}
}
}).mount('#app')
</script>