目录
定位到导入的 vue
使用导入映射表 (Import Maps) 来告诉浏览器如何定位到导入的 vue:
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<title>world</title>
</head>
<body>
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
}
}
</script>
<div id="app">{{ message }}</div>
<script type="module">
import { createApp, ref } from 'vue'
createApp({
setup() {
const message = ref('Hello Vue!')
return {
message
}
}
}).mount('#app')
</script>
</body>
</html>
标签:web,vue,createApp,导入,message,ruby
From: https://www.cnblogs.com/waterruby/p/17594003.html