Comments (2)
直接在這個git主頁右上角 Code -> Download zip
下載後的.zip包直接進dcat後台 開發工具-> 本地安裝 指定剛剛那個zip就能裝上
這裡我提供小改的測試樣本
protected function form()
{
return Form::make(new yourstepsl(), function (Form $form) {
$form->multipleSteps()
->remember() // 记住表单步骤,默认不开启
->width('950px')
->add('基本信息', function ($step) {
$step->text('type', 'Types')->required();
})
->add('兴趣爱好', function ($step) {
$step->text('content', '內容');
// 事件
$step->shown(function () {
return <<<JS
Dcat.info('兴趣爱好');
console.log('兴趣爱好', args);
JS;
});
})
->add('地址', function ($step) {
$step->text('addr', 'Addr');
})
->done(function ($done){
$newId = $done->getNewId();
return '成功!! newId: '.$newId;
//return view('admin::form.done-step', $data);
});
});
}
}
from form-step.
直接在這個git主頁右上角 Code -> Download zip 下載後的.zip包直接進dcat後台 開發工具-> 本地安裝 指定剛剛那個zip就能裝上
這裡我提供小改的測試樣本
protected function form() { return Form::make(new yourstepsl(), function (Form $form) { $form->multipleSteps() ->remember() // 记住表单步骤,默认不开启 ->width('950px') ->add('基本信息', function ($step) { $step->text('type', 'Types')->required(); }) ->add('兴趣爱好', function ($step) { $step->text('content', '內容'); // 事件 $step->shown(function () { return <<<JS Dcat.info('兴趣爱好'); console.log('兴趣爱好', args); JS; }); }) ->add('地址', function ($step) { $step->text('addr', 'Addr'); }) ->done(function ($done){ $newId = $done->getNewId(); return '成功!! newId: '.$newId; //return view('admin::form.done-step', $data); }); }); } }
嘗試上述的方法沒有用,因為檔案數少,解決方式為直接將檔案移至專案裡面,在 Directory 底下建立 Extends,修正 namespace,修正 resource,public
app/Admin
├── Extends
│ └── FormStep
│ ├── Builder.php
│ ├── CompletionPage.php
│ ├── Form.php
,之後在 bootstrap.php 裡面引用,之後 formstep 就可以正常使用
/**
* FormStep
*/
Admin::css('vendor/dcat-admin-extensions/dcat-admin/form-step/css/step.css');
Admin::js('vendor/dcat-admin-extensions/dcat-admin/form-step/js/jquery.smartWizard.min.js');
Form::macro('multipleSteps', function ($builder = null) {
if (empty($this->context['steps'])) {
$this->context['steps'] = new App\Admin\Extends\FormStep\Builder($this);
}
if ($builder) {
if ($builder instanceof \Closure) {
$builder($this->context['steps']);
} elseif (is_array($builder)) {
$this->context['steps']->add($builder);
}
}
return $this->context['steps'];
});
from form-step.
Related Issues (5)
- 更新时,没有把数据带过来 HOT 2
- 擴展安裝連不上,有其它的資料可以參考嗎? HOT 4
- 可以提交一下 packages 吗?
- 分步表单失效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-step.