一、条件渲染
1. 相关指令
v-if <p v-if="tag === 'A'">这里是A</p>
v-else-if <p v-else-if="tag === 'C'">这里是C</p>
v_else < v-else>这里什么都不是</p>
2. 控制多个元素
<button @click="changeIs">切换</button>
3. 复用元素
<template v-if="isUserLogin">
<label>用户名</label>
<input type="text" placeholder="请输入用户名" key="userLoginForm">
</template>
<template v-else>
<label>邮箱</label>
<input type="text" placeholder="请输入邮箱" key="emailLoginForm">
</template>
<br>
<button @click="isUserLogin = !isUserLo