justpy-org / justpy

An object oriented high-level Python Web Framework that requires no frontend programming
https://justpy.io
Apache License 2.0
1.22k stars 96 forks source link

Qtree doesn't support toggle #665

Closed luongnv275 closed 1 year ago

luongnv275 commented 1 year ago

image above is the quasar result in vuejs

WolfgangFahl commented 1 year ago

Does this work in nicegui?

freemant2000 commented 1 year ago

It works for me. You can try the code below.

from justpy import *

def p1():
    wp=QuasarPage()
    tree=QTree(node_key="id", label_key="name",           
          nodes="""[
            {id: 'a1', name: 'name 1', children: [
              {id: 'a1-1', name: 'name 1-1', body: 'b1-1'},
              {id: 'a1-2', name: 'name 1-2'}] },
            {id: 'a2', name: 'name 2', children: [{id: 'a2-1', name: 'name 2-1'}] },
            ]""", 
          a=wp)
    tree.add_scoped_slot("body-b1-1", QToggle(text="Good"))
    return wp

WebPage.tailwind=False
justpy(p1)
freemant2000 commented 1 year ago

This is the look of the page. image

WolfgangFahl commented 1 year ago

see #685