gpt4 book ai didi

vue.js - Nuxt + SurveyJS : When using nuxt generate or nuxt build - get a maximum call stack size exceeded

转载 作者:行者123 更新时间:2023-12-03 20:43:04 26 4
gpt4 key购买 nike

我有survey-vue(surveyJS)在dev上运行良好,但是当我尝试部署时,登陆带有调查组件的页面时出现最大调用堆栈大小超出错误。
我在想这就是我导入插件的方式,但我不确定。
插件/survey-vue.js

import Vue from "vue";
import * as surveyVue from "survey-vue";

Vue.use(surveyVue);
nuxt.config.js
plugins: [
...
{
src: '~/plugins/survey-vue',
mode: 'client'
},
]
组件/Survey.vue
<template>
<div id="surveyElement" class="w-full inline-block">
<survey :survey="surveyRender" />
</div>
</template>

<script>
import * as surveyVue from "survey-vue";
export default {
props: {
json: {
type: Object
},
results: {
type: Object
}
},
data() {
const jsonSurvey = this.json;
const survey = new surveyVue.Model(jsonSurvey);

// style the survey
var myCss = {...};

survey.onComplete.add(survey => {
this.result = survey.data;
this.sendResults()
})

survey.css = myCss
return {
surveyRender: survey,
result: []
}
},
methods: {
sendResults () {
this.$emit('resultCaptured', this.result)
}
},
created () {

}
}
</script>
页/.vue
<template>
<div class="flex flex-col justify-center mx-auto w-full md:w-1/2 px-4">
<div class="w-auto mx-auto p-4 mt-12" v-if="surveyCreated">
<client-only>
<survey :json="json" :results="reportedSymptoms"></survey>
</client-only>
</div>
</div>
</template>
....
任何见解在这里表示赞赏。几天来一直试图调试这个,但无济于事。

最佳答案

修正:我已经调用了我的组件文件 Survey.vue,它与为插件的调查实例保留的名称相同。将我的组件文件更改为 SurveyComponent.vue 并解决了。感谢@kissu 让车轮转动

关于vue.js - Nuxt + SurveyJS : When using nuxt generate or nuxt build - get a maximum call stack size exceeded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66496792/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com