You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will notice that we cast the `$event` variable to `NativeEvent` in our template.
121
+
You will notice that we cast the `$event` variable to `Event` in our template.
122
122
This is to indicate the type of the `$event` variable to Vue GWT.
123
123
124
-
This means that if your `warn` method was actually declared like this: `void warn(NativeEvent event, String message)` it would break at compile time with an explicit error.
124
+
This means that if your `warn` method was actually declared like this: `void warn(Event event, String message)` it would break at compile time with an explicit error.
125
125
126
-
You don't have to import the `NativeEvent` class to use it in your template.
126
+
You don't have to import the `Event` class to use it in your template.
127
127
It's already imported by default for convenience.
128
128
129
+
`Event` comes from [Elemental2](https://github.com/google/elemental2).
130
+
It is the base for all DOM events.
131
+
You cast it to more specific events like `MouseEvent` or `KeyboardEvent` in your Component class.
132
+
129
133
You'll see further that `$event` can also be used when communicating between Components.
130
134
In those case you might cast it to another type, like `Todo` for example.
0 commit comments