@@ -30,26 +30,25 @@ def __init__(self) -> None:
3030 def create_ui (self ) -> None :
3131 with super ().create_ui () as layout :
3232 with layout .content :
33- with vuetify .VCard (classes = "mx-auto my-4" , max_width = 600 ):
34- with GridLayout (columns = 2 , classes = "mb-2" , gap = "0.5em" ):
35- InputField (v_model = "data.email_address" )
36- InputField (v_model = "data.full_name" )
37-
38- with HBoxLayout (classes = "mb-2" , gap = "0.5em" , valign = "center" ):
39- InputField (v_model = "data.show_phone_field" , type = "checkbox" )
40-
41- # Now, we can use show_phone_field to conditionally render the phone number field.
42- InputField (v_if = "data.show_phone_field" , v_model = "data.phone_number" )
43- # Following a v_if, we can use v_else_if and v_else.
44- html .Span ("{{ data.full_name }}'s phone number is hidden." , v_else_if = "data.full_name" )
45- html .Span ("Phone number is hidden." , v_else = True )
46-
47- with VBoxLayout (gap = "0.5em" ):
48- # We can also use v_show to conditionally render a field. Note that when using v_show, you won't
49- # be able to use v_else_if or v_else afterwards. There is a deeper discussion of the differences
50- # between v_if and v_show in the Vue.js documentation: https://vuejs.org/guide/essentials/conditional#v-if-vs-v-show.
51- vuetify .VBtn ("Toggle Comments Field" , click = self .view_model .toggle_comments )
52- InputField (v_show = "data.show_comments_field" , v_model = "data.comments" , type = "textarea" )
33+ with GridLayout (columns = 2 , classes = "mb-2" , gap = "0.5em" ):
34+ InputField (v_model = "data.email_address" )
35+ InputField (v_model = "data.full_name" )
36+
37+ with HBoxLayout (classes = "mb-2" , gap = "0.5em" , valign = "center" ):
38+ InputField (v_model = "data.show_phone_field" , type = "checkbox" )
39+
40+ # Now, we can use show_phone_field to conditionally render the phone number field.
41+ InputField (v_if = "data.show_phone_field" , v_model = "data.phone_number" )
42+ # Following a v_if, we can use v_else_if and v_else.
43+ html .Span ("{{ data.full_name }}'s phone number is hidden." , v_else_if = "data.full_name" )
44+ html .Span ("Phone number is hidden." , v_else = True )
45+
46+ with VBoxLayout (gap = "0.5em" , stretch = True ):
47+ # We can also use v_show to conditionally render a field. Note that when using v_show, you won't
48+ # be able to use v_else_if or v_else afterwards. There is a deeper discussion of the differences
49+ # between v_if and v_show in the Vue.js documentation: https://vuejs.org/guide/essentials/conditional#v-if-vs-v-show.
50+ vuetify .VBtn ("Toggle Comments Field" , click = self .view_model .toggle_comments )
51+ InputField (v_show = "data.show_comments_field" , v_model = "data.comments" , type = "textarea" )
5352
5453 def create_vm (self ) -> None :
5554 binding = TrameBinding (self .state )
0 commit comments