2

I am having problem specifying multiple attributes in any class at all.

if I have a key:value like

{"class":"javascript handlebar-js"}

and use it like this <div class={{class}}><div>

it only spits out <div class="javascript"><div>

when I want <div class="javascript handlebar-js"><div>

Sometimes I have one class sometimes I have multiple classes Is there any other way to do this besides putting all classes inside an array and using a with + each statement to move through each class and cramping up my object with unnecessary arrays? Not that I am sure if using said method would work.

any help would be appreciated

4

1 回答 1

1

正如 Pointy 所说,将类定义包含在简单或双引号中。

根据这些数据({"className":"javascript handlebar-js"}),

<div class="{{className}}"> </div>会产生<div class="javascript handlebar-js"></div>

<div class={{className}}> </div>会产生<div class="javascript" handlebar-js></div>

这两个结果在浏览器中的解释方式不同。

于 2013-10-28T12:21:22.893 回答