|
|
@@ -1,11 +1,31 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<h1>作用域插槽</h1>
|
|
|
+ <hr>
|
|
|
+ <hr>
|
|
|
+ <hr>
|
|
|
+ <Part2>
|
|
|
+ <template v-slot:s3="{list1}">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,index) in list1" :key="index">
|
|
|
+ {{ item.id }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </template>
|
|
|
+ <template v-slot:s1="{list1}">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,index) in list1" :key="index">
|
|
|
+ {{ item.name }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </template>
|
|
|
+ </Part2>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive} from 'vue'
|
|
|
+import Part2 from './Part2.vue';
|
|
|
|
|
|
</script>
|
|
|
<style lang='scss' scoped>
|