Weird thing about it is, it started to crash like this suddenly.
TypeError: this.$notify is not a function
I load Notification
on demand like import { Notification } from 'element-ui'
and then add it as a component
components: { Notification },
created () {
this.$notify({ ... });
}
Version:
Build system: Laravel-mix
Should have read more carefully the docs, in my approach it wasn't needed to add it as a component, I could simply do something like Notification.success(options)
add the folloing code after import { Notification } from 'element-ui'
Vue.prototype.$notify = Notification;
This thread helped me. Thanks.
<script>
import { Notification } from 'element-ui';
export default {
name: "blah",
data() {
return { }
},
methods: {
notify: function () {
Notification.success({title: "hello", message: "world", type: "success"});
}
},
computed: {
this.notify();
},
Most helpful comment
Should have read more carefully the docs, in my approach it wasn't needed to add it as a component, I could simply do something like
Notification.success(options)