vue-question-edit
v0.1.4
Published
试题编辑组件(数学、化学公式)
Downloads
5
Readme
vue-question-edit
DESCRIPTION 试题编辑组件-业务自用(带数学、化学公式)
NPM
npm install vue-question-edit --save
USAGE
<!-- index.html -->
<!-- 公式显示 及 编辑器 tinymce.min.js-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false, //关闭js加载过程信息
messageStyle: "none", //不显示信息
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ["\\(","\\)"] ], //行内公式选择符
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], //段内公式选择符
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'], //避开某些标签
ignoreClass:"comment-content" //避开含该Class的标签
},
"HTML-CSS": {
availableFonts: ["STIX","TeX"], //可选字体
},
showMathMenu:false
})
</script>
<script src="https://jty-common.oss-cn-beijing.aliyuncs.com/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="/static/js/mathml2latex.js"></script>
<script src="/tinymce/tinymce.min.js"></script>
<!-- main.js -->
import questionContent from 'vue-question-edit'
import 'vue-question-edit/lib/question.css'
Vue.use(questionContent)
<!-- 组件内 -->
<question-content :total-question="question"> </question-content>
data() {
return {
<!-- 默认参数 -->
question: {
score: 0,
questionStructureTypeId: 1,
questionStructureTypeName: '单选',
stemHtml: '',
answerHtml: null,
analysisHtml: null,
options: {
A: '',
B: '',
C: '',
D: ''
},
questionBlanks: [],
questionListens: [],
questionVideos: [],
schoolPhaseId: 4,
subjectId: 7,
questionTypeId: null,
questionTypeName: '',
questionType: {
id: null,
name: null,
parentId: null,
parentName: null
},
questionTypeIds: '',
difficultLevelId: 0,
difficultLevelName: '',
wrongCauseDiagnosisHtml: null,
famousTeacherAdviceHtml: null,
subjectAbilities: [],
coreAttainments: [],
subjectAbilityIds: [],
coreAttainmentIds: [],
knowledgePoints: [],
knowledgePointIds: [],
bookNodes: [],
bookNodeIds: [],
children: []
}
}
}
Author
shuai