|
|
@@ -9,6 +9,17 @@
|
|
|
<script>
|
|
|
import setChoiceQuestion from './components/setChoiceQuestion.vue'
|
|
|
import setQuestionsAndAnswers from './components/setQuestionsAndAnswers.vue'
|
|
|
+
|
|
|
+function debounce(func, wait) {
|
|
|
+ let timeout;
|
|
|
+ return function(...args) {
|
|
|
+ clearTimeout(timeout);
|
|
|
+ timeout = setTimeout(() => {
|
|
|
+ func.apply(this, args);
|
|
|
+ }, wait);
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
setChoiceQuestion,
|
|
|
@@ -74,7 +85,7 @@ export default {
|
|
|
this.saveTest();
|
|
|
},
|
|
|
// 保存
|
|
|
- saveTest: _.debounce(function() {
|
|
|
+ saveTest: debounce(function() {
|
|
|
const params = [{
|
|
|
uid: this.userid || '',
|
|
|
id: this.workData.id,
|