已更新至作用域插槽
This commit is contained in:
parent
dadd6ff863
commit
585e9392ff
|
@ -13,7 +13,7 @@
|
|||
<div slot-scope="item">
|
||||
<h1>这是父组件</h1>
|
||||
<span v-for="li in item">
|
||||
<span>{{li.join("__-_")}}</span>
|
||||
<span>{{li.join("-")}}</span>
|
||||
</span>
|
||||
</div>
|
||||
</apps>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!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">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../"></script>
|
||||
</html>
|
|
@ -0,0 +1,44 @@
|
|||
<!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">
|
||||
<apps>
|
||||
<div slot="frame">
|
||||
<input type="checkbox" name="" id="">
|
||||
</div>
|
||||
</apps>
|
||||
<apps></apps>
|
||||
<apps></apps>
|
||||
<apps></apps>
|
||||
</div>
|
||||
<template id="tpl">
|
||||
<div>
|
||||
<slot name="frame">
|
||||
<input type="text" name="" id="" placeholder="请输入文本框">
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
</body>
|
||||
<script src="../../JavaScript/vue.js"></script>
|
||||
<script>
|
||||
new Vue({
|
||||
el:"#app",
|
||||
components:{
|
||||
'apps':{
|
||||
template:"#tpl",
|
||||
data(){
|
||||
return {
|
||||
list:['内容1','内容2','内容3']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue