I'm trying to rut dat.gui in Vue3 environment. And I found npm dat.gui for Vue. According to the documentation, it says I need to import it in main.js and app.use(GUI) and then I could use it as a global component.
What I did is as below.
main.js
import DatGui from '@cyrilf/vue-dat-gui'
const app = createApp(App);
app.use(router)
app.use(DatGui)
in one of my components
<div class='horizontal-container dark-background white-text' v-if='showup' ref='container'>
<canvas id='myCanvas' ref='myCanvas'></canvas>
<div class='menu-text white-text medium medium-text'>This is Landing Page</div>
<year-select class='year-selection'></year-select>
<div>{{boroughData}}</div>
</div>
</transition>
<dat-gui closeText="Close controls" openText="Open controls" closePosition="bottom">
<dat-number v-model="cameraZ" :min="0" :max="5" :step="0.5" />
<dat-number v-model="maxRadius" :min="1" :max="5" :step="0.1"/>
<dat-number v-model="spacing" :min="1" :max="10" :step="0.5" />
</dat-gui>
data(){
return{
showup:false,
sRadius:2,
targetCounty:undefined,
mouse:{x:undefined,y:undefined},
getIntersect:false,
cWidth:undefined,
cHeight:undefined,
cameraZ:5,
maxRadius:5,
spacing:5
}
},
Then it throws an error message saying

What is wrong with my dat.gui?
@cyrilf/vue-dat-guiwas built for Vue 2, so you need to use the Vue 3 migration build to make the library work in your project.To setup your Vue CLI scaffolded project:
Install the Vue compatibility build and SFC compiler that matches your Vue build version (i.e., install
@vue/compat@^3.1.0and@vue/compiler-sfc@^3.1.0if you havevue@^3.1.0inpackage.json):Configure Webpack to alias
vueto the@vue/compatbuild, and setvue-loader's compatibility mode to Vue 2:demo