nuxt.js

Error: vuex do not mutate vuex store state outside mutation handlers Even with const passed to mutation

落花浮王杯 提交于 2020-08-10 19:20:47
问题 as advise by @skirtle on another same problem, used const to mutate my state but get error. to be more clear, my state is an empty array, it will be filled the first time, but i get the error if i even try to change my select!!! let alone send another mutation!! so i think if i fill my state before this, (in case of editing my product), i'll get the error the on first try too. here is the codes: <template> <div class="pt-6"> <v-row class="ma-0"> <v-col cols="12" md="12" class="pa-0"> <v-row

vue-awesome-swiper(swiperjs) on Nuxt js not working in production but works on dev

99封情书 提交于 2020-08-10 16:40:17
问题 I am using vue-awesome-swiper and have followed the steps here: https://github.com/surmon-china/vue-awesome-swiper. I have opted to register this plugin globally in Nuxt js. PROBLEM : The Dev works perfectly fine, the slides are on each page and the navigation works. The production, on the other hand, has all the slides on page one, the navigation works here leaving the other pages blank as all slides are on the first page. On dev: On production: These are my files: plugins/VueAwesomeSwiper

vue-awesome-swiper(swiperjs) on Nuxt js not working in production but works on dev

梦想的初衷 提交于 2020-08-10 16:36:26
问题 I am using vue-awesome-swiper and have followed the steps here: https://github.com/surmon-china/vue-awesome-swiper. I have opted to register this plugin globally in Nuxt js. PROBLEM : The Dev works perfectly fine, the slides are on each page and the navigation works. The production, on the other hand, has all the slides on page one, the navigation works here leaving the other pages blank as all slides are on the first page. On dev: On production: These are my files: plugins/VueAwesomeSwiper

vue-awesome-swiper(swiperjs) on Nuxt js not working in production but works on dev

情到浓时终转凉″ 提交于 2020-08-10 16:36:13
问题 I am using vue-awesome-swiper and have followed the steps here: https://github.com/surmon-china/vue-awesome-swiper. I have opted to register this plugin globally in Nuxt js. PROBLEM : The Dev works perfectly fine, the slides are on each page and the navigation works. The production, on the other hand, has all the slides on page one, the navigation works here leaving the other pages blank as all slides are on the first page. On dev: On production: These are my files: plugins/VueAwesomeSwiper

How to provide/inject into Vue root instance WITH nuxt and @vue/composition-api?

北战南征 提交于 2020-08-10 04:46:34
问题 I'm trying to use @vue/apollo-composable with my Nuxt-Ts application. This is the example how it should be injected into root instance on a "normal" Vue application: import { provide } from '@vue/composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' const app = new Vue({ setup () { provide(DefaultApolloClient, apolloClient) }, render: h => h(App), }) Problem: I don't know how to get access to the root instance in Nuxt-TS . I tried making a plugin, but it's injected

How to provide/inject into Vue root instance WITH nuxt and @vue/composition-api?

拥有回忆 提交于 2020-08-10 04:46:23
问题 I'm trying to use @vue/apollo-composable with my Nuxt-Ts application. This is the example how it should be injected into root instance on a "normal" Vue application: import { provide } from '@vue/composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' const app = new Vue({ setup () { provide(DefaultApolloClient, apolloClient) }, render: h => h(App), }) Problem: I don't know how to get access to the root instance in Nuxt-TS . I tried making a plugin, but it's injected

How to make Nuxt generated static spa files in dist hosted on AWS S3

梦想的初衷 提交于 2020-08-09 08:57:09
问题 How to host Nuxt Static web app in AWS S3? Firstly, I have tried and known how to generate static static SPA files in ./dist by calling nuxt generate . Secondly, AWS S3 supports static web hosting, but it seems that the site have to be accessed by visiting the 'index.html' in that bucket. So, I came to this problem, for example, I got a bucket 'demo2020', and I upload Nuxt/Vue files in the ./dist into that. I have also set the bucket and files in in public. After these, I can visit images in

点亮你的Vue技术栈,万字Nuxt.js实践笔记来了

邮差的信 提交于 2020-08-07 11:28:13
前言 作为一位 Vuer(vue开发者),如果还不会这个框架,那么你的 Vue 技术栈还没被点亮。 Nuxt.js 是什么 Nuxt.js 官方介绍: Nuxt.js 是一个基于 Vue.js 的通用应用框架。 通过对客户端/服务端基础架构的抽象组织,Nuxt.js 主要关注的是应用的 UI渲染。 我们的目标是创建一个灵活的应用框架,你可以基于它初始化新项目的基础结构代码,或者在已有 Node.js 项目中使用 Nuxt.js。 Nuxt.js 预设了利用 Vue.js 开发服务端渲染的应用所需要的各种配置。 如果你熟悉 Vue.js 的使用,那你很快就可以上手 Nuxt.js 。开发体验也和 Vue.js 没太大区别,相当于为 Vue.js 扩展了一些配置。当然你对 Node.js 有基础,那就再好不过了。 Nuxt.js 解决什么问题 现在 Vue.js 大多数用于单页面应用,随着技术的发展,单页面应用已不足以满足需求。并且一些缺点也成为单页面应用的通病,单页面应用在访问时会将所有的文件进行加载,首屏访问需要等待一段时间,也就是常说的白屏,另外一点是总所周知的 SEO 优化问题。 Nuxt.js 的出现正好来解决这些问题,如果你的网站是偏向社区需要搜索引擎提供流量的项目,那就再合适不过了。 我的第一个 Nuxt.js 项目 我在空闲的时间也用 Nuxt.js 仿掘金 web

😉我用 Nuxt.js 仿了个掘金

前提是你 提交于 2020-08-07 09:39:42
前言 首先肯定是要夸夸掘金啦,最开始从 CSDN 到 博客园 再到 掘金,个人感觉掘金的技术氛围非常的nice,真是个宝藏社区👏。技术文章大多以前端为主,对前端开发者非常友好,质量也是歪瑞古的。学习是不可能不学习的,这辈子都不可能不学习的,只有敲敲代码复制粘贴才能维持得了生活这样子,进到这里到处都是大佬,沸点骚话又好听,呜哟~ 超喜欢这里的,哈哈哈😀 说实话,我绝大多数的学习动力还真是掘金带来,不管是文章还是小册都能充实到自己,还有基本每天早上坐地铁会刷下掘金,然后触及到我的知识盲区,然后就是 怀疑人生 动力满满的一天(不知道有没有和我一样的😅)。所以,当你在掘金看到的越多,你就会发现自己越 废物 渺小(来一波毒鸡汤,时刻提醒自己要保持学习)。 废话不多说了,进入正题~ 介绍 nuxt-juejin-project 是一个使用 Nuxt.js 仿写掘金的学习项目,主要使用 : nuxt + koa + vuex + axios + element-ui 。该项目所有数据与掘金同步,因为接口都是通过 koa 作为中间层转发(找接口真是个累活😅),重新定义接口路由以及对部分接口数据做处理。页面主要数据请求通过 asyncData 在服务端进行拼接并返回前端渲染。在写项目时我会尽可能的使用 Nuxt.js 提供的配置以及一些技术点(服务端渲染、接口转发、路由配置、权限验证等)

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No “exports” main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json

那年仲夏 提交于 2020-08-06 16:54:41
问题 I'm having trouble building my nuxt images in a travis CI pipeline. My local environment is ubuntu 18.04 - docker version 19.03.11 docker-compose version 1.24.1 I'm able to build and run my images locally but on the travis CI I get the following error Step 5/7 : RUN npm run build ---> Running in d3e9433b79f0 > nuxt_app@1.0.0 build /app > nuxt build ℹ Production build ✔ Builder initialized ✔ Nuxt files generated ℹ Compiling Client ℹ Starting type checking service... ℹ Using 1 worker with