File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,10 @@ impl Component for App {
99
99
}
100
100
}
101
101
102
- export_components ! { App }
102
+ export_components ! {
103
+ /// This is the entry component for our Todo application
104
+ App
105
+ }
103
106
104
107
struct TaskList {
105
108
tasks : ValueContainer < Vec < ( bool , Rc < str > ) > > ,
Original file line number Diff line number Diff line change @@ -258,16 +258,30 @@ macro_rules! classnames {
258
258
/// # type Error = JsValue;
259
259
/// # fn try_from(_: JsValue) -> Result<Self, Self::Error> { todo!() }
260
260
/// # }
261
- /// export_components! { App as CounterApp, Counter }
261
+ /// export_components! {
262
+ /// /// Some doc comment for the exported component.
263
+ /// App as CounterApp,
264
+ /// Counter
265
+ /// }
262
266
/// ```
263
267
#[ macro_export]
264
268
macro_rules! export_components {
265
269
{ } => { } ;
266
- { $Component: ident $( , $( $tail: tt ) * ) ? } => {
267
- $crate:: export_components! { $Component as $Component $( , $( $tail ) * ) ? }
270
+ {
271
+ $( #[ $meta: meta] ) *
272
+ $Component: ident $( , $( $tail: tt ) * ) ?
273
+ } => {
274
+ $crate:: export_components! {
275
+ $( #[ $meta] ) *
276
+ $Component as $Component $( , $( $tail ) * ) ?
277
+ }
268
278
} ;
269
- { $Component: ty as $Name: ident $( , $( $tail: tt ) * ) ? } => {
279
+ {
280
+ $( #[ $meta: meta] ) *
281
+ $Component: ty as $Name: ident $( , $( $tail: tt ) * ) ?
282
+ } => {
270
283
$crate:: paste! {
284
+ $( #[ $meta] ) *
271
285
#[ allow( non_snake_case) ]
272
286
#[ allow( dead_code) ]
273
287
#[ doc( hidden) ]
You can’t perform that action at this time.
0 commit comments