Professional Documents
Culture Documents
4.if Else Vue Conditional Rendering
4.if Else Vue Conditional Rendering
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
</head>
<body>
<div id="app">
<div v-show="stateLampu">
Lampu menyala
</div>
</div>
<script type="module">
createApp({
data() {
return {
stateLampu: false
},
methods: {
toggleLampu() {
this.stateLampu = !this.stateLampu
}).mount('#app')
</script>
</body>
</html>