<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <div v-if='isuser'>
            <label for="username">用户账号</label>

            <input id="username" key='username' type="text" placeholder="用户账号">
        </div>
        <div v-else>
            <label for="email">用户邮箱</label>
            <input id="email" key='email' type="text" placeholder="用户密码">
        </div>
        <button @click="isuser=!isuser">切换类型</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                isuser: true,
            },
            methods: {

            }
        })
    </script>
</body>

</html>

运行结果