Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.26k stars 526 forks source link

Install breaks `@typeparam TableItem` and `@context` #271

Closed Gander7 closed 4 years ago

Gander7 commented 4 years ago

Using dotnet version 3.0.100-preview9-014004

Aftering completing the readme install into a blazor service project. My pagination breaks which uses @typeparam TableItem and @context

Sample of my code: Pagination:

@typeparam TableItem
@inherits PaginationBase<TableItem>

...

<table>
    <thead>
        <tr>@GridHeader</tr>
    </thead>
    <tbody>
        @foreach (var item in ItemList)
        {
            <tr>@GridRow(item)</tr>
        }
    </tbody>
</table>

Use of Pagination (Page.cs):

 <Pagination Items="@data" PageSize="10">
        <GridHeader>
                <th>Field 1</th>
                <th>Field 2</th>
                <th>Field 2</th>
        </GridHeader>
        <GridRow>
                <td>@context.Field1</td>
                <td>@context.Field2</td>
                <td>@context.Field3</td>
        </GridRow>
    </Pagination>

Errors Generated:

obj\Debug\netcoreapp3.0\Razor\Pages\Page.razor.g.cs(116,162): error CS0246: The type or namespace name 'TableItem' could not be found (are you missing a using directive or an assembly reference?)
Pages\Page.razor(21,25): error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.IEnumerable<MyModel>' to 'System.Collections.Generic.IEnumerable<TableItem>'
Pages\Page.razor(31,22): error CS0103: The name 'context' does not exist in the current context 
Pages\Page.razor(32,22): error CS0103: The name 'context' does not exist in the current context
Pages\Page.razor(33,22): error CS0103: The name 'context' does not exist in the current context

Double checked, build was working before install process. Are there changes I need to make to existing code to get blazorise to play nice? Am I just missing something? Or is there something else?

Please let me know if there is any other information that I can provide.

stsrki commented 4 years ago

I don't recognize any component in your example? Are they all you custom components?

Current version of Blazorise 0.8.5 supports 3.0.0-preview9.19457.4. Since the newest framework is released just a couple of hours ago I still haven't upgrade it so probably that's the reason for your error.

stsrki commented 4 years ago

New version is published. Can you confirm the error has gone or still there?

Edit* Don't forget to manage static files https://github.com/stsrki/Blazorise#5-static-files

stsrki commented 4 years ago

Closing as there is no way to reproduce error. If you need more help please reopen the issue.