Cài đặt và sử dụng cdn (ok)
v2
C:\xampp\htdocs\vujs\index.html
<!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>C:\xampp\htdocs\vujs\app.js
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;
		}
	},
});v3 https://vuejs.org/guide/quick-start.html#without-build-tools
<script src="https://unpkg.com/vue@3"></script>
<div id="app">{{ message }}</div>
<script>
  Vue.createApp({
    data() {
      return {
        message: 'Hello Vue!'
      }
    }
  }).mount('#app')
</script>Previous[ERROR]WARNINGS in child compilations (Use 'stats.children: true' resp. '--stats-chil dren' ... (ok)NextComponent (ok)
Last updated