Notification Pro version leads to error message


Topic: Notification Pro version leads to error message

Pletnev asked 4 years ago

Expected behavior

Show notification**

Actual behavior**

Error message: Cannot read property 'info' of undefined

Resources (screenshots, code snippets etc.)

var vm = new Vue({ el: '#form',
 components: { mdbInput: mdbvue.mdbInput, mdbSelect: mdbvue.mdbSelect, mdbDatePicker: mdbvue.mdbDatePicker, mdbContainer: mdbvue.mdbContainer, mdbRow: mdbvue.mdbRow, mdbCol: mdbvue.mdbCol, mdbBtn: mdbvue.mdbBtn, mdbIcon: mdbvue.mdbIcon },
...methods: 
{ this.$notify.info({ message: 'Hi! I am info message.', position: 'top right', timeOut: 5000 }); }

Magdalena Dembna staff premium answered 4 years ago

First of all, make sure that your code is correct - you can find working examples here: https://mdbootstrap.com/docs/vue/advanced/notifications/ . Make sure that this import is included in your main.js file - this is, the most likely, the reason for the error message:

import Notify from 'mdbvue/lib/components/Notify'
Vue.use(Notify)

In future tickets, please make use of our formatting tools. Best regards, Magdalena


lgmaxim31 answered 2 years ago

Why you just do not edit the official documentation ?


lgmaxim31 answered 2 years ago

How can I use it in vuex store ?


Mikołaj Smoleński staff answered 2 years ago

@lgmaxim31 please open a new issue with a detailed explanation of problems.

Keep coding,  Mikołaj from MDB


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 6.7.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 8
  • Provided sample code: No
  • Provided link: No