nuxt.js

How to use workbox-webpack-plugin together with Nuxt PWA

假如想象 提交于 2020-02-25 04:09:07
问题 I'm currently on Nuxt with PWA Plugin, including workbox module. However if I'm not mistaken this plugin doesn't allow to add the assets generated by webpack to precaching. Is it possible to use workbox-webpack-plugin for only generating the precaching part of the sw.js file? If so, how would it be done? There is some documentation on https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin, however I'm not sure how to apply this to the Nuxt PWA context. 回答1: Turns out

Conditional module loading in Nuxt.js

你离开我真会死。 提交于 2020-02-21 13:27:11
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Conditional module loading in Nuxt.js

偶尔善良 提交于 2020-02-21 13:25:08
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Conditional module loading in Nuxt.js

时间秒杀一切 提交于 2020-02-21 13:23:53
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Conditional module loading in Nuxt.js

橙三吉。 提交于 2020-02-21 13:21:57
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Conditional module loading in Nuxt.js

心不动则不痛 提交于 2020-02-21 13:21:33
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Conditional module loading in Nuxt.js

情到浓时终转凉″ 提交于 2020-02-21 13:21:13
问题 I have a module for Google Tag Manager in my Nuxt.js config, like so: modules: [ [ '@nuxtjs/google-tag-manager', { id: 'GTM-XXXXXXX' } ] ] This is working fine but I am wondering how I can conditionally load this module based on the value of a cookie set by the site? We have a mechanism by which the user can select certain cookies to accept or deny and a part of that is to block tracking scripts. Is there any recommended way to do this with modules or scripts loaded via the config? Ideally,

Dynamically choose compontent in Nuxt Router

一世执手 提交于 2020-02-05 03:56:24
问题 I would like to render the same component for all languages. The translation will be done inside the component. The url and component relationship should look like so: pseudocode: browserurl: "/blogpost_1" nuxtcomponent: "blogpost_1" browserurl: "/en/blogpost_1" nuxtcomponent: "blogpost_1" browserurl: "/randompage" nuxtcomponent: "randompage" browserurl: "/en/randompage" nuxtcomponent: "randompage" My approach was to do the following, unfortunately i cant find a way to access pathMatch.

Set path to output folder in Nuxt

梦想的初衷 提交于 2020-02-02 10:07:20
问题 Working in windows, I'm able to generate a static site from my nuxt project using $ npx nuxt generate I'm interested in setting the output folder for the generated static files. I'm reading through https://nuxtjs.org/api/configuration-generate which explains that I should be looking at the generate property. However, I don't understand how to modift or access the generate property. How cam I access the generate property? EDIT; I changed the nuxt.config.js build object to : build: { publicPath

How to watch on Route changes with Nuxt and asyncData

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-31 03:58:06
问题 Hi everybody i'm trying to watch on route changes in my nuxt js app. Here my middleware: export default function ({ route }) { return route; but i don't know what to write here } index.vue File middleware: [routeReact] i'm trying to write this: app.context.route = route but it says to me that app.context doesn't exist Here's the point of my question i'm trying to update my data that gets from my api with axios on page if route changing like this this the page i'm clicking link to next page :