【发布时间】:2021-09-06 19:59:06
【问题描述】:
如何在惯性中将插槽或道具传递给layout 组件?
例如,这里有一个ForgotPassword 组件:
<template>
<slot name="title">Forgot Password</slot>
Forgot pw stuff goes here...
</template>
<script>
import CardLayout from "@/Layouts/CardLayout";
export default {
layout: CardLayout,
}
这里是CardLayout 组件:
<template>
<h1>{{ $slots.title }}</h1>
<slot/>
</template>
h1 标签内没有任何显示...
【问题讨论】: