2.模块化开发
-- 未经授权禁止转载 --


html

<div id="app">
    {{ msg }}

    <h2>{{ web.title }}</h2>
    <h3>{{ web.url }}</h3>
</div>

js

<script type="module">
    import { createApp, reactive } from './vue.esm-browser.js'
    
    createApp({
        setup() {
            const web = reactive({
                title: "邓瑞编程",
                url: "dengruicode.com"
            })

            return {
                msg:"success",
                web
            }
        }
    }).mount("#app")
</script>


VSCode 扩展

       Live Server