0
点赞
收藏
分享

微信扫一扫

vue3.0 js全局组件案例

fbd4ffd0717b 2022-02-03 阅读 57


<!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>全局组件</title>
<script src="https://unpkg.com/vue@next"></script>
</head>

<body>
<div id="app">
<mycomponent></mycomponent>
</div>
<script>
const vm = Vue.createApp({
data() {
return {
msg: "红红色台亚瑟"
}
},
template: `<div><h2>{{msg}}</h2></div>`
}).mount('#app');
</script>
</body>

</html>
举报

相关推荐

0 条评论