<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App vue-project</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app">
<div id="app">{{ message }}</div>
</div>
<script>
// 配置对象
const counter = {
data() {
return {
message: 'hello vue'
}
}
}
// 创建应用,配置对象传入,mount挂载
let app = Vue.createApp(counter).mount('#app')
console.log(app.message);
</script>
</body>
</html>
使用js的方式引入vue
于 2023-05-25 15:12:10 首次发布