代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原生JS如何输出Vue中的data数据</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="myapp">
        {{site}}+1
    </div>
    <div id="test">123456789</div>
    <script>
        let myapp = new Vue({
            el:'#myapp',
            data:{
                site:"城南博客",
                url:"www.gzj2001.com"
            },
        })

        document.write(myapp.url);
        document.getElementById("test").innerHTML = myapp.site;
    </script>
</body>
</html>