map通過迭代元素數組的每個元素,然後獲取給定屬性的值來工作。 。
你必須知道的屬性是什麼,你正在傳遞元素的數組
即:如果你有一個collection.products,和你想抓住把手在每個產品集合,然後在一個逗號分隔字符串返回它們,你可以再做:
{{ collection.products | map: 'handle' | join: ',' }}
,並會列出所有產品的處理:
across-the-mountains,alpine-meadow,appproaching-storm,arboretum-poster,around-st-peters,basic-tee,bryce-canyon-sunrise,crocuses,flower-print-mum,gatineau-park-stream,product-2,hooded-sweater,product-3,last-light-at-sandbanks,last-light-on-opabin-plateau,library-of-parliament,library-of-parliament-poster,long-beach-tofino,magnolia,meadow-2,mountain-panoramic-2,ready-to-frame-tulip-print-10,ready-to-frame-tulip-print-11,ready-to-frame-tulip-print-12,ready-to-frame-tulip-print-13,ready-to-frame-tulip-print-14,ready-to-frame-tulip-print-15,ready-to-frame-tulip-print-2,ready-to-frame-tulip-print-3,ready-to-frame-tulip-print-4,ready-to-frame-tulip-print-6,ready-to-frame-tulip-print-7,ready-to-frame-tulip-print-8,ready-to-frame-tulip-print-9,ready-to-frame-tulip-print-5,ready-to-frame-tulip-print-1,sample,shopify-shirt,shirt,sunset-on-lake-ohara,t-shirt,library-of-parliament2,test-prdouct,test-prod,test-product-1,test-product,testing,the-arboretum-poster,the-arboretum-central-experimental-farm,the-colosseum