What you should't do

As I told you in Usage section - there is no difference between methods defined in notifications: {...} section and methods defined in methods: {...}section.

That's also mean you can't have two methods with same names in those sections, cause they will overlaps.

So, BAD:

export default {
    name: 'DemoView',
    data () {
      //...
    },
    methods: {
      showLoginError () { //Same name!!!
       //...
      }
    },
    notifications: {
      showLoginError: { //Same name!!!
        title: 'Login Failed',
        message: 'Failed to authenticate',
        type: 'error'
      }
    }
  }

GOOD:

export default {
    name: 'DemoView',
    data () {
      //...
    },
    methods: {
      loginError () {
       //... this.showLoginError() // or whatever
      }
    },
    notifications: {
      showLoginError: {
        title: 'Login Failed',
        message: 'Failed to authenticate',
        type: 'error'
      }
    }
  }

results matching ""

    No results matching ""