H
H
hckn2018-12-29 15:55:19
Vue.js
hckn, 2018-12-29 15:55:19

How to change the variable passed in scoped slot?

<renderless-modal>
      <div slot-scope="{show}">
        <modal-overlay
          v-if="show"
          @clicked="show = false"
        >
        </modal-overlay>
      </div>
    </renderless-modal>

It doesn't work Is there a way to change the variable from here on event?
@clicked="show = false"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alex, 2018-12-29
@hckn

you can pass the method
codesandbox.io/s/3y07qjyw06

N
nvdfxx, 2018-12-29
@nvdfxx

Binding
<div :slot-scope="{show}">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question