@@ -27,8 +27,8 @@ And cargo-make: `cargo install --force cargo-make`
27
27
To start, clone [ the quickstart repo] ( https://github.com/David-OConnor/seed-quickstart ) :
28
28
` git clone https://github.com/david-oconnor/seed-quickstart.git ` ,
29
29
run ` cargo make build ` in a terminal to build the app, and ` cargo make serve ` to start a dev server
30
- on ` 127.0.0.0:8000 ` . If you'd like the compiler automatically check and recompile when you
31
- make changes, run ` cargo make watch ` instead of ` cargo make all ` .
30
+ on ` 127.0.0.0:8000 ` . If you'd like the compiler to automatically check and recompile when you
31
+ make changes, run ` cargo make watch ` instead of ` cargo make build ` .
32
32
33
33
34
34
## A little deeper
@@ -150,27 +150,27 @@ fn view(model: &Model) -> impl View<Msg> {
150
150
151
151
// Attrs, Style, Events, and children may be defined separately.
152
152
let outer_style = style! {
153
- " display " => " flex" ;
154
- " flex-direction " => " column" ;
155
- " text-align " => " center"
153
+ St :: Display => " flex" ;
154
+ St :: FlexDirection => " column" ;
155
+ St :: TextAlign => " center"
156
156
};
157
157
158
158
div! [ outer_style ,
159
159
h1! [ " The Grand Total" ],
160
160
div! [
161
161
style! {
162
162
// Example of conditional logic in a style.
163
- " color " => if model . count > 4 {" purple" } else {" gray" };
164
- " border " => " 2px solid #004422" ;
165
- " padding " => unit! (20 , px );
163
+ St :: Color => if model . count > 4 {" purple" } else {" gray" };
164
+ St :: Border => " 2px solid #004422" ;
165
+ St :: Padding => unit! (20 , px );
166
166
},
167
167
// We can use normal Rust code and comments in the view.
168
168
h3! [ format! (" {} {}{} so far" , model . count, model . what_we_count, plural ) ],
169
169
button! [ simple_ev (Ev :: Click , Msg :: Increment ), " +" ],
170
170
button! [ simple_ev (Ev :: Click , Msg :: Decrement ), " -" ],
171
171
172
172
// Optionally-displaying an element
173
- if model . count >= 10 { h2! [ style! {" padding " => px (50 )}, " Nice!" ] } else { empty! [] }
173
+ if model . count >= 10 { h2! [ style! {St :: Padding => px (50 )}, " Nice!" ] } else { empty! [] }
174
174
],
175
175
success_level (model . count), // Incorporating a separate component
176
176
0 commit comments