-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
weiwait
committed
May 16, 2023
1 parent
66b0e2f
commit d56ef2a
Showing
6 changed files
with
732 additions
and
599 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,4 +149,7 @@ | |
'2.12.5' => [ | ||
"optimizing", | ||
], | ||
'2.12.6' => [ | ||
"fixed bugs", | ||
], | ||
]; |