如何访问EJS中的[object Object]?

时间:2019-01-29 08:39:06

标签: ejs

我要用throws the error for the allowed values for status上传带有多幅图像的多幅图像,然后将upload.any()传递到req.files,然后得到imgdet。 我需要显示所有图像。

这是我的控制台结果:

[object Object]

这4个对象代表4张图像。

我的代码:

[object Object],[object Object],[object Object],[object Object]

这是一个物品包含的内容

<span class="product-border">   
   <% var itm = JSON.stringify(item[i].imgdet); %>     
   <% console.log(itm); %>     
   <img src="/uploads/<%= item[i].imgdet %>" alt="">                                                
</span> 

1 个答案:

答案 0 :(得分:0)

首先是一个数组,访问每个元素都需要对其进行迭代。最简单的迭代器是for循环,因此您可以在此处使用它。

class MyXmlInvoice(object):

    @OutputAsXmlAttribute('invoiceNo', 'http://my.company.com/invoice-schema')
    @property
    def id(self) -> 'str':
        pass

    @id.setter
    def id(self, value: str):
        pass


    @OutputAsXmlElement('Price', 'http://my.company.com/invoice-schema')
    @property
    def price(self) -> 'int':
        pass

    @price.setter
    def price(self, value: int):
        pass


# This is the use case for the objects where MyXmlSerializer uses 
# the meta data on price & id to influence the serialization
xmlInvoice = MyXmlInvoice()
xmlInvoice.price = 3
xmlInvoice.id = "0001"

xmlSerializer = MyXmlSerializer()
xmlData = xmlSerializer.Serialize(xmlInvoice)
相关问题