render editors

This commit is contained in:
Edward Yang 2022-07-08 15:57:41 +08:00
parent 1cec3c3fc3
commit 81595a5b18
5 changed files with 89 additions and 3 deletions

View File

@ -12,8 +12,9 @@ class DesignController extends Controller
{
public function index(Request $request)
{
$data = [];
$data = [
'editors' => ['de-slide_show']
];
return view('design.builder.index', $data);
}
}

View File

@ -34,6 +34,8 @@ class ShopServiceProvider extends ServiceProvider
$this->loadViewComponentsAs('shop', [
'sidebar' => AccountSidebar::class,
]);
$this->loadDesignComponents();
}
protected function loadSettings()
@ -75,4 +77,11 @@ class ShopServiceProvider extends ServiceProvider
$menuCategories = CategoryRepo::getTwoLevelCategories();
View::share('categories', $menuCategories);
}
protected function loadDesignComponents()
{
$this->loadViewComponentsAs('de', [
'slide_show' => \Beike\Shop\View\DesignEditor\SlideShow::class,
]);
}
}

View File

@ -0,0 +1,37 @@
<?php
/**
* SlideShow.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-07-08 15:23:18
* @modified 2022-07-08 15:23:18
*/
namespace Beike\Shop\View\DesignEditor;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class SlideShow extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Get the view / contents that represent the component.
*
* @return View|
*/
public function render(): View
{
return view('design.module.slideshow.editor.index');
}
}

View File

@ -0,0 +1,37 @@
<?php
/**
* SlideShow.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-07-08 15:23:18
* @modified 2022-07-08 15:23:18
*/
namespace Beike\Shop\View\DesignRender;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class SlideShow extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Get the view / contents that represent the component.
*
* @return View|
*/
public function render(): View
{
return view('design.module.slideshow.editor.index');
}
}

View File

@ -21,7 +21,9 @@
<body class="page-design">
<div class="design-box">
<div class="sidebar-edit-wrap">
@foreach($editors as $editor)
<x-dynamic-component :component="$editor" class="mt-4" />
@endforeach
</div>
<div class="preview-iframe">
<iframe src="{{ shop_route('home.index') }}" frameborder="0" id="preview-iframe" width="100%" height="100%"></iframe>