nuxt.js

Nuxt generate FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

∥☆過路亽.° 提交于 2020-08-06 07:58:06
问题 I'm trying to nuxt generate my static (with dynamics url params) html pages. Here's my route config in the nuxt.config.js file routes: function () { let domain = 'https://example.com' if (process.env.NUXT_ENV === 'dev' || process.env.NUXT_ENV === 'development') { domain = 'https://dev-example.com' } if (process.env.NUXT_ENV === 'local') { domain = 'http://localhost:3002' } let rooms = axios.get(domain + '/nuxt/rooms').then((res) => { if(res && res.data.length){ return res.data.map((room) => {

Nuxt open link into modal

谁都会走 提交于 2020-08-04 08:08:41
问题 I'm building a Nuxt application that has a list of products and clicking on one of them open a dedicated page of the product. It is working fine. Structure is: /pages/featured // directory of products /pages/product/:id/:slug // Dedicated product page Now I wish to add a new feature: I wish to keep the dedicated page of the product if clicked from a page that is not the directory of the products or if people land directly on it; I wish to open an almost full-screen dialog of the product on

Nuxt dynamic routes based on Firebase data

本小妞迷上赌 提交于 2020-07-23 07:46:40
问题 I'm having a Nuxt app in SPA mode hosted on Netlify . I'm authenticating and storing users data with Firebase . I want to display all users profile on a dynamic routes. For example https://www.myapp.com/users/martcube (where "martcube" is the documentid) Is this even posible with the given stack of technologies ? If you need extra code or info, write me and i will edit my question right away. 回答1: if I understand your problem correctly, you want to: have a dynamic route for each documentid (

Nuxt dynamic routes based on Firebase data

半腔热情 提交于 2020-07-23 07:45:07
问题 I'm having a Nuxt app in SPA mode hosted on Netlify . I'm authenticating and storing users data with Firebase . I want to display all users profile on a dynamic routes. For example https://www.myapp.com/users/martcube (where "martcube" is the documentid) Is this even posible with the given stack of technologies ? If you need extra code or info, write me and i will edit my question right away. 回答1: if I understand your problem correctly, you want to: have a dynamic route for each documentid (

Vuex populate data from API call at the start

☆樱花仙子☆ 提交于 2020-07-23 06:20:48
问题 apologies for the simple question, I'm really new to Vue/Nuxt/Vuex. I am currently having a vuex store, I wish to be able to populate the list with an API call at the beginning (so that I would be able to access it on all pages of my app directly from the store vs instantiating it within a component). store.js export const state = () => ({ list: [], }) export const mutations = { set(state, testArray) { state.list = testArray } } export const getters = { getArray: state => { return state.list

How to refetch user in Vuex with Nuxt Auth Module?

我的未来我决定 提交于 2020-07-21 03:49:19
问题 Short Question: Is it possible to update the user data in Vuex manually via the Nuxt Auth Module? Why do I have that Question: My problem is this. I save some Likes/Follows in MongoDB in the user document. My authentication is realized with Nuxt Auth. Nuxt Auth stores my user document in Vuex on login. If an user likes something now, it will be stored in the database, but I don't get it into the auth state of Nuxt Auth in Vuex. An alternative (I thought) would be to change the data in Vuex

How to refetch user in Vuex with Nuxt Auth Module?

我是研究僧i 提交于 2020-07-21 03:49:12
问题 Short Question: Is it possible to update the user data in Vuex manually via the Nuxt Auth Module? Why do I have that Question: My problem is this. I save some Likes/Follows in MongoDB in the user document. My authentication is realized with Nuxt Auth. Nuxt Auth stores my user document in Vuex on login. If an user likes something now, it will be stored in the database, but I don't get it into the auth state of Nuxt Auth in Vuex. An alternative (I thought) would be to change the data in Vuex

Nuxtjs async await in a page doesnt work on page refresh

天大地大妈咪最大 提交于 2020-07-20 14:03:54
问题 Am trying to fetch data in the fetch method of my page using vuex and nuxt js but whenever a person refreshes the page it fails but works when i navigate through nuxt navigation So in my page i have fetch ({ store, params }) { store.dispatch('getJobspecialisims') }, //IVE ALSO TRIED ASYNC async asyncData (context) { await context.store.dispatch('getJobspecialisims'); }, SO in my vuex action i have async getJobspecialisims({commit}){ await axios.get(process.env.baseUrl+'/job-specialisims')

How to serve cdn links for assets in NuxtJS?

末鹿安然 提交于 2020-07-10 12:00:57
问题 I am working on a NUXTJs to create server side rendered website. My question is that although there is a assets/static folder in nuxt project structure to serve images & static files, i want to set cdn link for all my image source. What would be the best approach to do that? Possible ways I can think of: Vuex Store - set baseURL for the images and then use in components env - use environment variable to set the cdn URL TIA 回答1: You can set it via publicPath property in nuxt.config export

How to serve cdn links for assets in NuxtJS?

▼魔方 西西 提交于 2020-07-10 11:58:21
问题 I am working on a NUXTJs to create server side rendered website. My question is that although there is a assets/static folder in nuxt project structure to serve images & static files, i want to set cdn link for all my image source. What would be the best approach to do that? Possible ways I can think of: Vuex Store - set baseURL for the images and then use in components env - use environment variable to set the cdn URL TIA 回答1: You can set it via publicPath property in nuxt.config export