how to pass arguments to listeners in lit-element?
Asked Answered
Y

1

5
<div @click=${this.click_cb.bind(this, record)}>${record.msg}<div>

Is this the correct way to pass an argument to a listener?

Yaws answered 21/8, 2019 at 6:44 Comment(0)
P
10

You should also be able to do this

<div @click=${() => this.click_cb(record)}>${record.msg}<div>
Platitudinous answered 21/8, 2019 at 18:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.