slim icon indicating copy to clipboard operation
slim copied to clipboard

How about add vue.js support?

Open vmvwebworks opened this issue 8 years ago • 11 comments

It's possible to add vue.js support?

vmvwebworks avatar Dec 12 '17 16:12 vmvwebworks

I use vue.js in Slim quite a bit. What are you having trouble with?

thom801 avatar May 21 '18 17:05 thom801

how you do it? Rails App?

vmvwebworks avatar May 22 '18 20:05 vmvwebworks

You just use the directive tags like normal but make them slim syntax.

.signed-in v-if="user"
  = "Wecome, {{ user.name }}"
  a.sign-out-button v-on:click="signOut" Sign out

thom801 avatar May 22 '18 22:05 thom801

a good gem? they are also this, how can i well integrate without a complexity? https://github.com/vuetifyjs/vuetify i use Turbolinks, all ok?

vmvwebworks avatar May 28 '18 12:05 vmvwebworks

@thom801 How to use in slim? css: only generate

smoothdvd avatar Sep 07 '18 06:09 smoothdvd

For example, you can't do this: span.taxonomyTitle {{ category.title }}

Or you get this error: Slim::Parser::SyntaxError Expected attribute

Why? The curly braces don't mean anything special in Slim, so why won't it just leave them alone? Why do I have to do a weird trick to show the curly braces?

andrew-koster- avatar Aug 23 '19 02:08 andrew-koster-

Re-read the Slim syntax docs, and I see that there are three (!!!) equivalent ways to delimit HTML attributes, IN ADDITION to not using a delimiter at all.

Why do we need to be able to mix-and-match [], () and {}? Why do we need three different types of parentheses that do the exact same thing? This is the kind of anti-feature that people use as an argument against Slim.

Pick one, tell us what it is, and we'll stick to that. And don't pick {}. That will conflict with every client-side template engine on the planet.

andrew-koster- avatar Aug 23 '19 02:08 andrew-koster-

Sure, you can do this to fix the bug: https://stackoverflow.com/questions/17687389/slim-template-interprets-myjsvar-as-html-attribute-grouping

But why isn't this behavior just the default? It doesn't make sense that someone should have to spend extra time searching, reading and configuring, just to get a sensible default that's compatible with client-side code.

Again, this is the kind of anti-feature that people bring up when I propose using Slim.

andrew-koster- avatar Aug 23 '19 02:08 andrew-koster-

Related note: pug, which is based on slim can be used within vue components in the webpacker asset pipeline.

pyrareae avatar Jan 11 '20 02:01 pyrareae

similar issue: https://github.com/slim-template/slim/issues/722

noraj avatar Aug 25 '20 16:08 noraj

Related note: pug, which is based on slim can be used within vue components in the webpacker asset pipeline.

I don't like pug, is there something more similar to slim?

brauliobo avatar Sep 29 '22 14:09 brauliobo