Activities

shahzaibanwar009

shahzaibanwar009 posted a new question

hare •

config with miniToaster in nuxt app

config with miniToaster in nuxt app
I installed vue-notification plugin and configured it.it is working fine
i wanna add mini-toaster how to setup mini-toaster

seybsen

seybsen posted a new question

hare •

[deleted]

[deleted]

alanaasmaa

alanaasmaa posted a new feature request

hare •

idea Refresh page on when clicking same page router link.

What problem does this feature solve?

Hello,

I have tried to fight with this issue couple of times for now.

I have a page running on default layout.
The page contains a form that will switch form with success page after filling.

Sometimes users would like to refresh the page by clicking the logo/router-link.

But when current page is active the router wont refresh the page.
How could i do that?

I have tried to add :key to everywhere.
I found this but not working => https://github.com/nuxt/nuxt.js/issues/2285

What does the proposed changes look like?

I think it would be good to have a option for template. That by default wont allow refreshing/reloading and when re clicking it reloads.

RafaelGSS

RafaelGSS posted a new question

hare •

meanmenu + nuxtjs

Hello everyone.

I would like use meanmenu jQuery on my application NuxtJS. But, i don't understanding how to work the plugins.

I trying like bellow:

nuxt.config.js

plugins:[
      '~plugins/meanmenu-import'
    ]

plugins/meanmenu-import.js

import Vue from 'vue'

import * as js from 'meanmenu.js'

Vue.use(js);

plugins/meanmenu.js

The raw content of: https://github.com/meanthemes/meanMenu/blob/master/jquery.meanmenu.js

Just copy paste.

--

I using on content like:

export default {
    mounted() {

     /* jQuery MeanMenu */
    $('#mobile-menu-active').meanmenu({
        meanScreenWidth: "991",
        meanMenuContainer: ".mobile-menu-area .mobile-menu",
    });

    }
}

And receive the error:

$(...).meanmenu is not a function
JasonGaoG

JasonGaoG posted a new question

hare •

Have no Ant Design Vue choice when I use create-nuxt-app to init project

I don't have Ant Design Vue UI framework choice when I use create-nuxt-app to init project, Below is the choice list:
? Use a custom UI framework
none
bootstrap
vuetify
bulma
tailwind
element-ui
buefy

Hxmic

Hxmic posted a new question

hare •

Upgrade error

Hello everyone .My project upgrade 1.0 to 2.0, According to this steps , first I delete node_modules .nuxt.js and package-lock.json, then npm upgrade , npm install finally npm run dev,

This is new error

in ./.nuxt/client.js friendly-errors 19:45:27

Module build failed (from ./nodemodules/@nuxt/webpack/nodemodules/babel-loader/lib/index.js): friendly-errors 19:45:27
Error: Plugin/Preset files are not allowed to export objects, only functions.

msymms

msymms posted a new question

hare •

Accessing store in js plugin

I have reviewed the comments in c6898 and still am a little confused. I have an asyncData call in nuxtServerInit loading an array and storing in the store. I have code that needs to be run in four separate components and wanted to combine this into a plugin/mixin. However, this code (which of course works fine in the component locally) requires access to the store. I get an error stating the prop 'getters' is undefined. Here is the js code for the methods/mixin.

util.js

getCategories (categories) {
    const loadedCategories = this.$store.getters.loadedCategories;
    let categoryNames = [];
    for (let idx in loadedCategories) {
      for (let cIdx in categories) {
        if (loadedCategories[idx].uuid === categories[cIdx]) {
          categoryNames.push(loadedCategories[idx].name);
          console.log(loadedCategories[idx].name);
        }
      }
    }
    return categoryNames;
  }

plugin code (main.js)

import Vue from 'vue'
import util from '~/static/js/util.js'

Vue.mixin({
  methods: {
    listCategories(categories) {
      util.getCategories(categories)
    }
  }
})

Again, I load the required array in the nuxtServerInit action and commit it to the store

Is the store available at this stage of the lifecycle??

TIA

podlebar

podlebar posted a new bug report

hare •

bug PWA Icon Module is generating false output

Version

2.6.0

Reproduction link

https://gist.github.com/podlebar/c3199368b0ff026d0454e2c77115297f

Steps to reproduce

Install nuxt pwa module as described in the docs. Add a 512px icon.png to static folder.

What is expected ?

icon prop should be array without size

What is actually happening?

the icon prop gets the size of the icons array passed. mainfest.json is not valid anymore

brandonpittman

brandonpittman posted a new bug report

hare •

bug Nuxtent cannot load pages when @nuxtjs/axios is registered as a module

Version

v0.4.0

Reproduction link

https://github.com/brandonpittman/nuxtent-module/blob/master/examples/multiple-content-types/nuxt.config.js

Steps to reproduce

Add '@nuxtjs/axios' to nuxt.config.js

What is expected ?

Should display content files

What is actually happening?

Can't find page

aaaguirrep

aaaguirrep posted a new question

hare •

Best practice to load all information of users after the authentication process

Hi, i am not a developer but i am deploying a web application using nuxt and i have a doubt about load all information related to the users once in the application, all the information is managed by vuex. I need to load all information after the authentication process because i am showing a dashboard to the user. I have read and found the next options but i don't know where is the best practice without impact the performance of the application:

1.- Load all information in the same vuex action where the user authenticates. I have an action to validate the user and password and it creates the cookies and token sessions. I can load all information in the same action but the authentication process could be slower. With this option the load of information is executed just once.

2.- Load all information in the main/dashboard component by the fetch function consuming an vuex action (do a dispatch). It works but i am seeing that when i browse to the main/dashboard component the fetch function is always appearing. Load of information should be once after the authentication process.

3.- I also am using the nuxtserverinit to load all information when the users press F5 button or reload the web application but if i do a reload in the main/dashboard component i am seeing nuxtserverinit and fetch functions . I am duplicating resources.

I really appreciate your help.

Thanks in advance.

Regards,
Arsenio

nathanchase

nathanchase posted a new feature request

hare •

idea Add function to nuxt.config that passes current instance to enable access to URL path

What problem does this feature solve?

I want to try to add a canonical URL declaration like so:

link: [
    { rel: 'canonical', href: `https://www.mysite.com/${this.$route.path}` },
],

but it doesn't seem that there's anyway to access this.$route from within nuxt.config

@manniL suggested in Discord that creating a function that passes the current instance would enable this.

Having a single place in the config to declare a canonical URL structure would prevent having to declare it on every individual page component.

What does the proposed changes look like?

Add a function to nuxt.config to allow access to the router (path).

Perhaps something like this.$instance.$route.path ?

Modcat

Modcat posted a new question

hare •

Babel

IE11 support I have followed the docs on the page…

https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app

However, Babel is not poly filling or transpiling for example parameters with default values such as…

function( param = 0 ) { …

…Transpiled to…

function( param ) { param = param || 0

I have this in my package.json

"browserslist": [
"> 0%",
"last 2 versions",
"IE 10"
],

I have this in my nuxt.config.js at the top

import '@babel/polyfill'

THEN under build, I've added the babel key

babel: {
presets: [
[
'@nuxtjs/babel-preset-app',
{
useBuiltIns: 'entry',
targets: { ie: 11 }
}
]
]
}

It does not transpile at all, still have erros and no poly filling.

begueradj

begueradj posted a new bug report

hare •

bug baseURL does not take effect

Version

v0.4.0

Reproduction link

https://github.com/begueradj/nuxt-axios-baseurl-bug

Steps to reproduce

  1. Clone my repo and change to the resulted directory
  2. Intall the dependencites: yarn install
  3. Launch the server: yarn run dev

What is expected ?

I expect the number of displayed posts to be 100.

This means in pages/index.vue, when I have this code:

mounted() {
    axios.get('/posts')
    .then(response => {
      this.posts = response.data
    })
    .catch(e => {
      this.errors.push(e)
    })
  }

axios should recoginize the baseURL configuration key I set in nuxt.config.js and thus fetch data from http://jsonplaceholder.typicode.com/posts

Here is my nuxt.config.js file content related to axios module:

modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    ['@nuxtjs/axios', {
      baseURL: 'http://jsonplaceholder.typicode.com'
    }]
  ],
  /*
  ** Axios module configuration
  */
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
  },

What is actually happening?

The number of displayed posts is 0
axios is trying to send a get request to http://localhost/posts instead of http://jsonplaceholder.typicode.com/posts

Additional comments?

I checked similar posts but nothing worked for me.

Thanks,
Billal Begueradj

hzpOfLegends

hzpOfLegends posted a new question

hare •

Nuxt.js SPA First load white screen ?

How to solve Nuxt.js SPA First load white screen ? Here's the screenshot .
1540263338(1).jpg

tuotuogenjudi

tuotuogenjudi posted a new question

hare •

it find error,when I use element-ui.

Module Error (from ./node_modules/[email protected]/index.js):

/Users/siludaluan/Documents/testSpace/nuxt-custom/pages/login.vue
11:9 error Require self-closing on HTML elements (

) vue/html-self-closing
17:11 error Require self-closing on Vue.js custom components (<el-input>) vue/html-self-closing
17:53 error Attribute "type" should be on a new line vue/max-attributes-per-line
17:65 error Attribute "auto-complete" should be on a new line vue/max-attributes-per-line
17:85 error Attribute "placeholder" should be on a new line vue/max-attributes-per-line
17:102 error Attribute "on" should be on a new line vue/max-attributes-per-line
20:11 error Require self-closing on Vue.js custom components (<el-input>) vue/html-self-closing
20:37 error Attribute "model" should be on a new line vue/max-attributes-per-line
20:37 error Attribute "v-model.trim" should go before "type" vue/attributes-order
20:71 error Attribute "auto-complete" should be on a new line vue/max-attributes-per-line
20:91 error Attribute "placeholder" should be on a new line vue/max-attributes-per-line
20:108 error Attribute "on" should be on a new line

begueradj

begueradj posted a new feature request

hare •

idea Integrate Jest for testing

What problem does this feature solve?

Suggest Integrates unit testing through Jest during the scaffolding process.
This template ignores totally software testing concepts as it does not suggest any tool to run unit tests, for example.

What does the proposed changes look like?

During the scaffolding process, Jest should be selectable to run unit tests.

wangsong3635

wangsong3635 posted a new question

hare •

How to use middleware in layout

Environment: Node v10.12.0 + [email protected] + [email protected]

Description: when I use middleware in layout files,it does not work.

import { Vue, Component } from 'nuxt-property-decorator';
@Component 
export default class LayoutIndex extends Vue {
    middleware() {
        return 'auth';
    };
};

How to use middleware in Layouts or Pages ?

wangYaNan112618

wangYaNan112618 posted a new question

hare •

layout加载问题

线上环境,用完整的地址访问时总是加载默认的layout即default,忽略自己本来设置好的layout,但是在本地环境正常

wangxueliang

wangxueliang posted a new feature request

hare •

idea support ant-design-vue

What problem does this feature solve?

Add more Ui framework options is always good

What does the proposed changes look like?

Add ant-design-vue Ui framework

mahmoudrady248

mahmoudrady248 posted a new question

hare •

Nuxt or vue CLI better in big project ?

I have big project what is the best way to use in Nuxt or vue cli3
when can I use Nuxt and when can I use vue cli ?