父组件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<template>
<div>

<describe :type="before" :dataList={} />
div>
template>

<script>
import headerBar from "./headerBar/index";
import describe from "./describe/index";

export default {
components: { headerBar, describe },
data() {
return {
before: "课前",

};
},
methods: {}
};
script>

子组件接收:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<template>
<div>
<h3>
{{type}}-描述
h3>
div>
template>

<script>
export default {
props: ["type"],
methods: {}
};
script>

转载请保持原始链接

原始链接: https://ru23.com/note/7ee1b4c2.html