JSFiddle - React, Tailwind, and code Playground
by moku23
HTML
<!DOCTYPE html>
<html>
<head>
<title>Hello Vue</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
</head>
<body>
<div id="greeting">
<!-- Modify this part of the HTML -->
{{greeting}}
</div>
<script>
var vm = new Vue({
el: '#greeting',
data: {
name: "Vue",
greeting: 'Hello'
},
created(){
if(this.name === "Vue"){
console.log(this.greeting + ' ' + this.name)
return this.greeting = this.greeting + ' ' + this.name
}
return this.greeting = this.greeting + ' Name!'
}
});
</script>
</body>
</html>