mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
Update Window
example in web-sys
This commit is contained in:
parent
7a2f55d2d1
commit
a3e160744e
@ -46,7 +46,8 @@ use web_sys::Window;
|
|||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn make_the_window_small() {
|
pub fn make_the_window_small() {
|
||||||
// Resize the window to 500px by 500px.
|
// Resize the window to 500px by 500px.
|
||||||
Window::resize_to(500, 500)
|
let window = web_sys::window().unwrap();
|
||||||
|
window.resize_to(500, 500)
|
||||||
.expect("could not resize the window");
|
.expect("could not resize the window");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user