-
Notifications
You must be signed in to change notification settings - Fork 648
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
If we could also allow multiple @page
per component that would be perfect.
builder => | ||
{ | ||
builder.AddStringToken(Resources.PageDirective_RouteToken_Name, Resources.PageDirective_RouteToken_Description); | ||
builder.Usage = DirectiveUsage.FileScopedSinglyOccurring; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have FileScopedMultipleOccurring
? There will be cases where people want to define more than one URL pattern that maps to the same component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
|
||
// Only process the first directive occurrence. The parser will have already flagged multiple | ||
// usages as errors. | ||
var pageDirective = (DirectiveIntermediateNode)directives[0].Node; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As previous comment, would be good if we allowed multiple.
|
||
namespace Microsoft.AspNetCore.Blazor.Components | ||
{ | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here
83b5acc
to
e5dce13
Compare
Adds the @page directive and support for specifying routes in components
at compile time.
For now the route is required and must begin with a leading /.