Access slot-scope from computed property or method


is it possible to access the variable containing a slot-scope from within a computed property or a method?




Does this answer your question - vm-slots:


Maybe i can’t figure it out in the docs but my usecase is: I wrote a renderless component that expose some data via scoped slot. I want to use that data to compute a classname object for the wrapping element.

i mean i can make it work by using the array syntax (or spread operator if you have the tools for that)

      <div slot-scope={someState} 
         { 'extra-state-class': someState === true}

This works (and solves the issue) but i was wondering if can use that someState inside the computed someComputedClassnames.

     computed: {
        someComputedClassnamess() {
          return {
            'base-class': true
              Is it possible to acess scoped slot props object in computed property?
            //'extra-state-class': state === true,

I wrote a codesandbox sample to illustrate the case!
Thanks in advance! :slight_smile:


You can’t access those values from a computed property.


Thanks for the clarification!