slim-lang-loader icon indicating copy to clipboard operation
slim-lang-loader copied to clipboard

Pass arguments to partial

Open nicmosc opened this issue 7 years ago • 1 comments

When loaded in JS, is there any way you can pass variables to the partial? This is needed if you have some conditional rendering within the partial, e.g.:

.PCard__expand
      - if label
        .PCard__label = label

nicmosc avatar Aug 11 '18 13:08 nicmosc

I guess maybe there's a slimrb compiler that works in the browser that could be used...

however without that, I don't know how it could be done .... currently the slim is compiled server-side before the website is served ... and since we cannot pass variables in require calls (webpack requires them to be 'statically analyzable') I'm not sure how we would pass that info over to webpack.

MaxPleaner avatar Oct 27 '19 22:10 MaxPleaner