This commit is contained in:
15
05_react/uebungen/u08_badge-2/src/components/ProductList.jsx
Normal file
15
05_react/uebungen/u08_badge-2/src/components/ProductList.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import ProductListItem from './ProductListItem';
|
||||
|
||||
const ProductList = (props) => {
|
||||
// const { } = props;
|
||||
|
||||
return (
|
||||
<ul className="m-list-products list-group">
|
||||
<ProductListItem title="Product 1" description="lorem ipsum" price={10} />
|
||||
<ProductListItem title="Product 2" price={20}>
|
||||
Ipsum lorem
|
||||
</ProductListItem>
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
export default ProductList;
|
||||
@@ -0,0 +1,15 @@
|
||||
// Übung 5: Erweiterung der ProductListItem-Komponente
|
||||
// Passe die ProductListItem-Komponente wie folgt an:
|
||||
|
||||
// Erweitere die ProductListItem-Komponente um ein weiteres Prop namens description, so dass der Produktbeschreibungstext entweder über das description-Prop oder als Kind-Komponente übergeben werden kann.
|
||||
|
||||
// Verwende das description-Prop, um den Beschreibungstext anzuzeigen, wenn er übergeben wird.
|
||||
|
||||
// Erweitere die Komponente um eine optionale Prop namens price, um den Preis des Produkts übergeben und anzuzeigen.
|
||||
|
||||
const ProductListItem = (props) => {
|
||||
// const { } = props;
|
||||
|
||||
return <></>;
|
||||
};
|
||||
export default ProductListItem;
|
||||
Reference in New Issue
Block a user