nuxt.js

Vuetify breakpoints not working in Nuxt.js

a 夏天 提交于 2019-12-07 08:12:12
问题 I'm working on a project using Nuxt.js as SSR engine and Vuetify as styling framework. In one of my templates I have such code: <v-layout row wrap align-center :class="{ 'mb-4': $vuetify.breakpoint.smAndDown }">...</v-layout> As you can see, I want to apply mb-4 class only if I am on small screens and smaller ones. But when I load this on desktop large screen and inspect element, this class is attached even though screen resolution does not match logic for applying this class. However,

Deploy Nuxt.js to Google App Engine Return 502 Bad Gateway

本秂侑毒 提交于 2019-12-06 12:23:21
问题 Hi is there anyone who has tried to deploy nuxt app to Google App Engine. I have tried from nuxt regular and express template, it shows 502 Bad Gateway. I don't modify anything from create-nuxt-app command. My app.yaml file contains runtime: nodejs env: flex Is there anything wrong with my setup or maybe there are some additional setup I have to do? Here is my package.json { "name": "nuxt-pwa-vuetify-starter", "version": "1.0.0", "description": "Nuxt.js + PWA + Vuetify.js starter project",

Vuetify CSS comes after my own CSS with Nuxt 2.0

安稳与你 提交于 2019-12-06 11:40:22
In my test project https://github.com/alechance/nuxt-vuetify-lodash I'm trying to write my own CSS. However Vuetify CSS always comes after my CSS in my <head> , any idea how I can order my styles so my CSS comes after? I do not want to end up writing important! 来源: https://stackoverflow.com/questions/53087096/vuetify-css-comes-after-my-own-css-with-nuxt-2-0

NuxtJS & SASS Loader - Build with sass-loader (SCSS) on production

我是研究僧i 提交于 2019-12-06 11:22:44
I've added this lines to build with sass-loader on development (local) server: nuxt.config.js module.exports = { mode: 'spa', build: { analyze: { analyzerMode: 'static', generateStatsFile: true, statsFilename: 'webpack-stats.json', openAnalyzer: false }, vendor: [ 'axios', 'vuetify' ], extend (config) { config.resolve.alias['vue'] = 'vue/dist/vue.common' const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader') vueLoader.options.loaders.scss = 'vue-style-loader!css-loader!sass-loader?' + JSON.stringify({ includePaths: [ path.resolve(__dirname), 'node_modules' ] }) } }

How to add external js file in Nuxt?

断了今生、忘了曾经 提交于 2019-12-06 07:18:18
I have js file called script.js in assets/js. Tried to include in nuxt.config.js like below: head: { title: pkg.name, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: pkg.description } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ], script: [ { src: '/assets/js/script.js', ssr: false } ] } But getting 'GET http://127.0.0.1:3000/assets/js/script.js 404 (OK)'. Simply keep your script.js file into static folder, because static folder treat as root folder. and change

“document is not defined” in Nuxt.js

我只是一个虾纸丫 提交于 2019-12-06 04:14:17
问题 I am trying to use Choices.js within a Vue component. The component compiles successfully, but then an error is triggered: [vue-router] Failed to resolve async component default: ReferenceError: document is not defined In the browser I see: ReferenceError document is not defined I think this has something to do with the SSR in Nuxt.js? I only need Choices.js to run on the client, because it's a client only aspect I guess. nuxt.config.js build: { vendor: ['choices.js'] } AppCountrySelect.vue

Data() VS asyncData() in Nuxt & vue

本小妞迷上赌 提交于 2019-12-06 04:04:40
问题 both data() and async data() gives the same result (and it is obvious that the results from asyncData() override the results from data() ) and both results in HTML code in the source code (i.e the code rendered in the server side) also both can be used to " await " the data to be fetched (ex: using axios) so, what is the difference between them? <template> <div> <div>test: {{test}}</div> <div>test2: {{test2}}</div> <div>test2: {{test3}}</div> <div>test2: {{test4}}</div> </div> </template>

Vue: method is not a function within inline-template component tag

梦想与她 提交于 2019-12-06 00:19:27
I have this component: <template> <div class="modal fade modal-primary" id="imageModal" tabindex="-1" role="dialog" aria-labelledby="ImageLabel" aria-hidden="true"> <div class="modal-dialog modal-lg animated zoomIn animated-3x"> <div class="modal-content"> <ais-index index-name="templates" app-id="BZF8JU37VR" api-key="33936dae4a732cde18cc6d77ba396b27"> <div class="modal-header"> <algolia-menu :attribute="category" :class-names="{ 'nav-item__item': 'nav-color', 'nav-item__link': 'nav-link', 'nav-item__item--active': 'active'}"> </algolia-menu> </div> <div class="modal-body"> <div class=

Vuetify breakpoints not working in Nuxt.js

蹲街弑〆低调 提交于 2019-12-05 17:15:38
I'm working on a project using Nuxt.js as SSR engine and Vuetify as styling framework. In one of my templates I have such code: <v-layout row wrap align-center :class="{ 'mb-4': $vuetify.breakpoint.smAndDown }">...</v-layout> As you can see, I want to apply mb-4 class only if I am on small screens and smaller ones. But when I load this on desktop large screen and inspect element, this class is attached even though screen resolution does not match logic for applying this class. However, styling is back to expected when I resize browser window. I've tried to manually dispatch 'resize' event in

How to deploy nuxt.js project on shared hosting?

一世执手 提交于 2019-12-05 15:18:34
Is it possible to deploy nuxt-js spa project in shared hosting like hostgator through cpanel? I have tried several time to run below command, it's generate dist folder but didn't work. My command: npm run build Can you help me please? npm run build Builds files for `npm run start` serving. And looks like you want it to be static files, which you just upload to hosting. So you should run: npm run generate then in `/dist/` you will find static spa. 来源: https://stackoverflow.com/questions/50021173/how-to-deploy-nuxt-js-project-on-shared-hosting