在phtml文件中,我刚刚添加了以下代码
$swatchBlock = $this->getLayout()
->createBlock("Magento\Swatches\Block\Product\Renderer\Listing\Configurable")
->setTemplate("Magento_Swatches::product/listing/renderer_widget.phtml");
echo $swatchBlock->setProduct($_item)->toHtml();
但最近基于UI组件和phtml进行查看的情况
$block->renderApp([
'widget_columns' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
如何在html中渲染颜色色板或将其添加为小部件选项?