我是Vue.js的初学者,不知道我想做的事情是否可行。
我有几个组件必须包含在同一个"布局1"中,而其他组件必须包括在另一个相同的"布局2"中。
组件看起来像:
<template>
<div>
bla bla ...
</div>
</template>
因此,在这个组件中,我发现可以做一些类似的事情:
<template>
<this component extends a layout...>
<div>
bla bla ...
</div>
</template>
在布局中,类似于
<template>
<my components will be rendered here...>
</template>
对于那些了解Laravel Blade的人来说,这是一件非常常见的事情(扩展布局(。
这种事情在Vue.js中可能发生吗?
它存在于Vue 2和Vue3!中!。以下是的示例