当前位置: 首页 > 工具软件 > form-builder > 使用案例 >

拖控件自动生产html,GitHub - yandou/Bootstrap-Form-Builder: 表单生成器,拖拽自定义表单,生成表单html以及表单控件json。在原有代码上简化了表单控件数量...

秦锐
2023-12-01

#Bootstrap Form Builder

Warning: Currently using Bootstrap v. 2.3.1  (Not Bootstrap 3 ready.)

##What's this?

A Drag-and-drop form builder for twitter bootstrap.

##Where can I see it in action?

It's hosted on github pages here.

###Notes

For development & debugging change the data-main for the require script tag in index.html

to point at assets/js/main.js. (Look just before the closing

tag!)

Once done, change it back to build for production using the build.js script in the assets/js/lib

folder and r.js. Then revert to assets/js/main-built.js

The full command is r.js -o assets/js/lib/build.js which should be run from the base directory.

Adding new form elements

In the js/data/ folder are yaml files, each of which corresponds to a tab in the form builder.

If you just want to add a new element you need to:

describe it in one of these files

parse the yaml to json using parse.rb in the same folder

create a corresponding template in the templates/snippet directory

If you want to add a new tab, you'll also need to adjust the app.js file to make sure the tab is loaded.

Don't forget to switch to main.js rather than main-built.js, or the changes you make before compiling with require.js won't show up!

需要安装node.js,然后在命令行中执行node r.js -o assets/js/lib/build.js,将生成文件assets/js/main-built.js

 类似资料: