image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据绑定-文本插值</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
        {{username}}
        <h1>{{username}}</h1>
        <p>{{pass}}</p>
    </div>
    <script>
        let myapp = new Vue({
            el:"#app",
            data:{
                id:1,
                username: "admin",
                pass:"null"
            }
        })
    </script>
</body>
</html>