Vue
[Vue3] Quasar Framework Boot File
jjineei
2023. 3. 29. 10:03
.quasar 파일 내부는 건들지 않는다.
특히, app.js파일!
quasar 내부에서 global property등록을 위해선
1. src>boot 폴더에 파일 추가하여 관리
- constants.js파일에 global property 설정
import { boot } from 'quasar/wrappers';
export default boot(({ app }) => {
app.config.globalProperties.hello = 'Hello Quasar!!';
});
2. 추가한 파일 인식하도록 config에 추가
//quasar.config.js 파일 내
boot: ['constants'],
3. Test
// App.vue파일
...
export default defineComponent({
name: 'App',
mounted(){
console.log('hello' , this.hello)
}
});
...