Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
weiwait committed May 16, 2023
1 parent 66b0e2f commit d56ef2a
Show file tree
Hide file tree
Showing 6 changed files with 732 additions and 599 deletions.
2 changes: 1 addition & 1 deletion resources/assets/css/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion resources/assets/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,269 changes: 672 additions & 597 deletions resources/assets/js/index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/DcatVueServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Weiwait\DcatVue\Field\MultipleSelect;
use Weiwait\DcatVue\Field\Number;
use Weiwait\DcatVue\Field\Select;
use Weiwait\DcatVue\Field\Sku;
use Weiwait\DcatVue\Field\Tag;

class DcatVueServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -65,6 +66,7 @@ public function init()
Form::extend('icon', Icon::class);
Form::extend('vIcon', Icon::class);
Form::extend('oIcon', Form\Field\Icon::class);
Form::extend('vSku', Sku::class);

Admin::requireAssets('@weiwait.dcat-vue');

Expand Down
53 changes: 53 additions & 0 deletions src/Field/Sku.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace Weiwait\DcatVue\Field;

use Dcat\Admin\Form\Field;
use Dcat\Admin\Support\Helper;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Weiwait\DcatVue\Field\Traits\FieldCommon;
use Weiwait\DcatVue\Field\Traits\HasWatch;

class Sku extends Field
{
use FieldCommon, HasWatch;

public function render()
{
/****************************** field ************************************/

if (!$this->shouldRender()) {
return '';
}

$this->setDefaultClass();

$this->callComposing();

$this->withScript();

/****************************** custom ************************************/

$this->withProvides();

$this->addVariables([
'provides' => $this->variables(),
]);

return view($this->view(), $this->variables());
}

protected function formatAttributes()
{
return $this->attributes;
}

protected function withProvides()
{
$this->addVariables([
'component' => 'Sku',
'mountId' => 'id' . md5(Str::uuid()),
]);
}
}
3 changes: 3 additions & 0 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,7 @@
'2.12.5' => [
"optimizing",
],
'2.12.6' => [
"fixed bugs",
],
];

0 comments on commit d56ef2a

Please sign in to comment.