Websharper: Using LI Tags

I want to create something like this:

<ul>
    <li>menu1
         <ul>
             <li>sub-menu1</li>
         </ul>
    </li>
    <li>menu2</li>
</ul>

So, I am writing the following code using WebSharper:

let el =
        UL [
            LI [
                Text "menu1"
                UL [
                    LI [Text "sub-menu1"]
                ]
            ]
            LI [Text "menu2"]
        ]

But it says that

UL [
    LI [Text "sub-menu1"]
]

must be of type IPagelet, but currently has type Element.

Does anyone have an idea on how to put text + something else under the li element using WebSharper?

Edit: just saying that I have a bug in stakc, I cannot comment or accept @Tarmil's answer ...

+4
source share
1 answer

, Text "menu1" UL [...] IPagelet Element . Element IPagelet, , , , F # . UL [...] IPagelet:

let el =
    UL [
        LI [
            Text "menu1"
            UL [
                LI [Text "sub-menu1"]
            ] :> IPagelet
        ]
        LI [Text "menu2"]
    ]

, , seq<IPagelet> -> Element seq<#IPagelet> -> Element. , , , .

+7

All Articles