vue v-if v-else
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<p v-if="showIf">{{ message }}</p>
<p v-else>{{ elseMessage }}</p>
</div>
<script>
const app = new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!',
elseMessage: 'Hello furong!',
showIf: true,
},
})
</script>
</body>
</html>