1.0.0 • Published 4 years ago

subject-editor-plugin v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

subject-editor-plugin

类似问卷星调查问卷的问题编辑器(包括单选题,多选题,填空题,附件上传)

示例:https://yumiko-liu.github.io/subject-editor-plugin/

开始

浏览器环境:

<script src="subject-editor-plugin.js"></script>
<script>
  var subjectEditor = new SubjectEditorPlugin({
    el: '#demo',
  });
</script>

通过 npm:

npm i subject-editor-plugin --save
import SubjectEditorPlugin from 'subject-editor-plugin';
const subjectEditor = new SubjectEditorPlugin({
  el: '#demo',
});

方法

event namedescriptionparameter of callback
getSubjects获取题目数据

参数

optiondescriptiontypedefaulte.g.
el要挂载的dom选择器String"#demo"
initData初始题目数据Array[][{ options: "雪碧", "雷碧", required: false, title: "你最爱的饮料?", type: 1 }]

关于 type :1: 单选题 2: 多选题 3: 填空题 4: 附件上传