【发布时间】:2018-10-26 22:24:50
【问题描述】:
假设我们有一个这样的组件。
<template>
<div class=" ">
<div class="flex-grow">{{title}}</div>
<div class=" p-5">
<!-- want to show here -->
</div>
</div>
<script>
export default {
props: ['title'],
mounted() {
console.log('Component mounted.')
}
}
</script>
我试试这个
<comp :title="'here'">
<h1> this is </h1>
</comp>
我想显示 html b.w vue 组件标签,就像我们在 react 中所做的那样。 我们如何实现这一目标
【问题讨论】:
-
我想你在找
<slot></slot>reference -
什么意思?
标签: vue.js vue-component