Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop-down list box on header #7

Open
qgx opened this issue Sep 28, 2020 · 1 comment
Open

drop-down list box on header #7

qgx opened this issue Sep 28, 2020 · 1 comment

Comments

@qgx
Copy link

qgx commented Sep 28, 2020

I want to add a language drop-down list box to the header part of each page. I think this part should be achieved by modifying the page/page.rs file, but I don’t know how to send events. any ideas?

div![select![
attrs! {At::Name => "lang"},
langs.iter().map(|lang| option![attrs! {At::Value => lang}, lang]),
input_ev(Ev::Change, |new_value| Msg::LangChanged(new_value)),
],],

@MartinKavik
Copy link
Member

I don’t know how to send events.

What's the problem in your code?

Also you can draw inspiration from the hamburger + menu (aka dropdown) explained in the official tutorial https://seed-rs.org/0.7.0/time_tracker_header_and_routing.

Don't hesitate to write to our #support channel on the Seed chat.


Note: The realworld example hasn't been updated for a long time, I wouldn't recommend to learn from it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants