我在不同项目中使用React和Vue作为前端。
在React中,我能够像这样用MyComponent包装模板。
<MyComponent>
<div>Here</div>
</MyComponent>
并且在MyComponent文件中
const MyComponent = ({children}) {
return (
<div className="my-component">{children}</div>
)
}
如何在vue中使用这种简单的技术?
您将要使用Slots。