changes
This commit is contained in:
parent
555523c27f
commit
1ed7de1b91
|
@ -1,16 +0,0 @@
|
|||
<!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">
|
||||
<cpn></cpn>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../js/vue.min.js"></script>
|
||||
<script src="../js/index.js"></script>
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
const create = Vue.extend({
|
||||
template: `
|
||||
<div>
|
||||
<h1>这是一个标签</h1>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
const cpn = Vue.component(
|
||||
'cpn', create
|
||||
)
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
})
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,31 @@
|
|||
<!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">
|
||||
<cpn></cpn>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../JavaScript/vue.min.js"></script>
|
||||
<script>
|
||||
// 易犯错点:创建组件和初始化组件时不需要new一个对象
|
||||
const extend= Vue.extend({
|
||||
template:`
|
||||
<div>
|
||||
<h1>你好呀</h1>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
Vue.component(
|
||||
'cpn',extend
|
||||
)
|
||||
const vue=new Vue({
|
||||
el:"#app"
|
||||
})
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue