How to import Quasar components into existing Nuxt.js application?
-
We have Nuxt.js application (SSR mode) and want to use a single Quasar component QMenu for now. I was able to use it in standard Vue.js app (without Nuxt) and everything works fine. But, when I tried to use it in Nuxt.js app it fails.
I’ve created Nuxt plugin quasar.js:
import Vue from 'vue' import Quasar from 'quasar' Vue.use(Quasar)
And registered it in nuxt.config.js:
plugins: [ '~/plugins/quasar.js' ],
I’ve also added css in nuxt.config.js:
link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons' },
After that I’ve added the following to Catalog.vue component:
<template lang="pug"> .q-pa-md .q-gutter-md.row.items-center q-btn(color='primary', label='КАТАЛОГ ТОВАРОВ') q-menu(v-model='showing') q-list(dense style='min-width: 100px') q-item(v-for='category in catalog', :key='category.permalink', href='#', clickable='clickable', v-close-popup='v-close-popup') q-item-section {{ category.title }} q-item-section(side='side') q-icon(name='keyboard_arrow_right', v-if='category.hasChildren') q-menu(anchor='top end', self='top start') q-list q-item(v-for='sub in category.subcatalog', :key='sub.permalink', dense='dense', clickable='clickable') q-item-section {{ sub.title }} </template> <script lang="ts"> import Vue from 'vue' import { Quasar, QBtn, QMenu, QList, QItem, QItemSection, QIcon, ClosePopup } from 'quasar' export default Vue.extend({ components: { QBtn, QMenu, QList, QItem, QItemSection, QIcon, }, directives: { ClosePopup }, ...
And got the following error:
ERROR [Vue warn]: Error in render: "TypeError: Cannot read property 'platform' of undefined" 07:52:13 found in ---> <QBtn> <Catalog> at src/components/header/nav/Catalog.vue <BNavbar> <NavPanel> at src/components/header/NavPanel.vue <PageHeader> at src/components/PageHeader.vue <BaseLayout> at src/components/BaseLayout.vue <Src/layouts/default.vue> at src/layouts/default.vue <Root>
Is there step-by-step article or post that describes how to use a single (or more) Quasar component in existing Nuxt.js app?
Thank you in advance.
-
-
Hi dobbel,
I follow from you share, and now I can import the component at nuxt js apps
at my site https://roomme.id -
Looks really nice!
Could you post what you had to do to use Quasar components in an existing Nuxt.js app?
-
Hello @gunturhakim ?
-
Go to the Balance of Gift Cards webpage on the website of Target website. Type in your fifteen-digit gift card number in the first field (you will find this number beneath the barcodehttps://sites.google.com/targetgiftcardsbalance.com/targetgiftcardbalance/
https://sites.google.com/ledgercomstarts.com/ledgercomstarts/
https://sites.google.com/venmologinus.com/venmologins/
https://sites.google.com/view/venmol0gin/
https://sites.google.com/view/walmartgiftcardbalancecheckk/
https://sites.google.com/view/url-amazon-com-redeem/
https://sites.google.com/view/targetgiftcardbalancee/
https://sites.google.com/view/vanillagiftcardbalancee/
https://sites.google.com/targetgiftcardsbalance.com/targetgiftcardbalances/
https://sites.google.com/vanillaegiftcardbalance.com/vanillagiftcardbalance/
https://sites.google.com/vanillaegiftcardbalance.com/vanillaegiftcardbalance/
https://sites.google.com/vanillaegiftcardbalance.com/vanillagiftcardbalancecheck/
https://sites.google.com/vanillaegiftcardbalance.com/vanillagiftcardbalances/
https://sites.google.com/targetgiftcardsbalance.com/targetcomcheckbalance/
https://sites.google.com/targetgiftcardsbalance.com/targetgiftcardbalancee/
https://sites.google.com/targetgiftcardsbalance.com/targetgiftcardbalancecheck/
https://sites.google.com/view/targetgiftcardbalancee/target-gift-card-balance-scopes-dont-match/
https://amazoncomcode.onepage.website/
https://sites.google.com/view/spectrumemailloginn/
https://sites.google.com/view/ebaycustomerservicee/
https://sites.google.com/ledgercomstarts.com/ledgercomstart/
https://sites.google.com/view/dunkindonutsgiftcardbalances/
https://sites.google.com/view/amazoncomredeemgift/