<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
<h1>{{name}}</h1>
<h1>{{name}}</h1>
<h1>{{names()}}</h1>
<h1>{{names()}}</h1>
</div>
<script>
const app = Vue.createApp({
data() {
return {
b: 'front',
s: 'back'
}
},
computed: {
name() {
console.log("computed");
return this.b + ' ' + this.s
}
},
methods: {
names() {
console.log("methods");
return this.b + ' ' + this.s
}
}
}).mount('#app')
</script>
</body>
</html>