admin_vue/10-组件化开发/04-组件注册语法糖/组件注册语法糖.html

43 lines
737 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>
</head>
<body>
<div id="app">
<scp></scp>
</div>
<div id="asp">
<asps></asps>
</div>
</body>
<script src="../../JavaScript/vue.js"></script>
<script>
// 全局注册组件
Vue.component(
'scp',{
template:`
<h1>你好Vue</h1>
`
}
)
const vue=new Vue({
el:"#app"
})
const asp=new Vue({
el:"#asp",
components:{
'asps':{
template:`
<div>
<h1>asp标签</h1>
</div>
`
}
}
})
</script>
</html>