Vue3相对于2来讲差别还是挺多的目前来看,初始化构造vue对象方法都不一样了,下面是vue3的vue实例创建方法
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app">{{name}}</div>
<script>
const vm={
data(){
return {
name:'hello vue3'
}
}
}
Vue.createApp(vm).mount('#app')
</script>
</body>
</html>