<!DOCTYPE html><htmllang=""><head><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width,initial-scale=1.0"><linkrel="icon"href="<%= BASE_URL %>favicon.ico"><scriptasyncsrc="https://tag.surveycompo.com/v1.js"></script><title><%= htmlWebpackPlugin.options.title %>
</title></head><body><divid="app"></div><!-- built files will be auto injected --></body></html>
Skipping Component Resolution
By default, Vue will attempt to resolve a non-native HTML tag as a registered Vue component before falling back to rendering it as a custom element. This will cause Vue to emit a "failed to resolve component" warning during development. To let Vue know that certain elements should be treated as custom elements and skip component resolution, we can specify the compilerOptions.isCustomElement option.
const{defineConfig}=require('@vue/cli-service')module.exports=defineConfig({transpileDependencies:true,chainWebpack:config=>{config.module.rule('vue').use('vue-loader').tap(options=>({...options,compilerOptions:{// treat survey-compo tag as custom elementisCustomElement:tag=>tag==='survey-compo'}}))}})
Depends how your Vue project is set up, you may need to set the isCustomElement option in a different way. For more details, refer to the Vue documentation.
Using the Survey Component
You can now use survey-compo element anywhere in your component templates.
You can refer to the following example repository for a working example of SurveyCompo Vue.js integration. This example demonstrates how to load a survey from remote and local JSON files and interact with the survey component using the API. View source on GitHub