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
Show [specs](../../spec/usage/components/action_spec.rb)
3
+
Show [specs](../../spec/usage/components/onclick_spec.rb)
4
+
5
+
The `onclick` component renders a div that runs a function when the user clicks on it. This is a simple component that can be used to wrap components with a onclick function that will emit a event. The event that must be emitted onclick can defined by passing a hash into the `onclick` component that has the key `emit`. See example below for more details.
6
+
7
+
```ruby
8
+
classPages::MyPage::Home < Matestack::Ui::Page
9
+
defresponse
10
+
components{
11
+
onclick(emit:"abc") do
12
+
plain "Hello world"
13
+
end
14
+
}
15
+
async rerender_on:"abc"do
16
+
plain "Render this text when the 'abc' event is emitted"
0 commit comments