将 jetstream 转换为反应时出现问题
problem while converting jetstream to react
在将 jetstream 中的 vue 文件转换为 react.js 文件时,我在模板标签中发现 # 我认为它与 Laravel 组件有关,但我不知道如何在 [=20= 中编写它] 组件。
在 Vue 中
<template #trigger>
<template #content>
在 livewire 中
<x-slot name="trigger">
<x-slot name="content">
React.js 中的等价物是什么?
它将是:
<trigger />
或
<trigger></trigger>
和
<content />
或
<content></content>
经过一番研究,我找到了解决方案
vue 有插槽它被称为命名插槽 Shorthand
“#”是 name= 的缩写,与
要了解有关插槽的更多信息,请观看有关插槽的 net ninja 视频 Vue JS 2 教程 #27 - 插槽
并阅读有关插槽的 vue 文档
https://vuejs.org/v2/guide/components-slots.html#Named-Slots-Shorthand
如果你知道反应,你可以轻松地通过道具传递它
在将 jetstream 中的 vue 文件转换为 react.js 文件时,我在模板标签中发现 # 我认为它与 Laravel 组件有关,但我不知道如何在 [=20= 中编写它] 组件。
在 Vue 中
<template #trigger>
<template #content>
在 livewire 中
<x-slot name="trigger">
<x-slot name="content">
React.js 中的等价物是什么?
它将是:
<trigger />
或
<trigger></trigger>
和
<content />
或
<content></content>
经过一番研究,我找到了解决方案 vue 有插槽它被称为命名插槽 Shorthand “#”是 name= 的缩写,与 要了解有关插槽的更多信息,请观看有关插槽的 net ninja 视频 Vue JS 2 教程 #27 - 插槽 并阅读有关插槽的 vue 文档 https://vuejs.org/v2/guide/components-slots.html#Named-Slots-Shorthand 如果你知道反应,你可以轻松地通过道具传递它