What you are trying does not work because you are using a string as the only argument and calling your mixin drum with one string. You do not share string arguments with the ',' character, so only your arg1 contains a value.
First let me fix your mixin bar
mixin bar(args) div each arg in args |
The code uses only one argument named "args". Some type of enumerated type or array type is expected for this argument. See the jade documentation for more information on iterations . Code block | #{arg} | #{arg} writes the arg value as plain text.
How to call this mixin? Instead of providing an argument as a string, you need to provide an array of arguments:
mixin bar(['arg1','arg2','arg3'])
If you want to pass a string as an argument, you will have to rewrite the mixing panel:
mixin barString(argString) - args = argString.split(','); div each arg in args | #{arg}
Then you can call mixString barString:
mixin barString("arg1,arg2,arg3")
Note that I removed the single quotes for this call.
source share