Open alvaro-canepa opened 4 years ago
Using TS with decorators is not possible to set the notificacions object, as say the doc. This must be a function type, returning the object options. But TS give error Property $error does not exists.
notificacions
Property $error does not exists
I made a mixin to use it.
// main.ts import Component from "vue-class-component"; Component.registerHooks(["notifications"]); // mixins/notify.ts import { Component, Vue } from "vue-property-decorator"; @Component export default class Notify extends Vue { notifications() { return { $error: { type: "error", title: "", message: "" }, $warning: { type: "warning", title: "", message: "" }, $info: { type: "info", title: "", message: "" }, $success: { type: "success", title: "", message: "" } }; } }
I think the fixed was in line 80 https://github.com/se-panfilov/vue-notifications/blob/ffdd19cacff28a1692eb9ac4886ff5b5c434c9c2/src/vue-notifications.ts#L80
pluginOptions[methodName] must be checked if is a function. something like
pluginOptions[methodName]
const pluginOptionsData = typeof pluginOptions === 'function' ? pluginOptions.call() : pluginOptions; const methodConfig = pluginOptionsData ? pluginOptionsData[methodName] : {};
Using TS with decorators is not possible to set the
notificacions
object, as say the doc. This must be a function type, returning the object options. But TS give errorProperty $error does not exists
.I made a mixin to use it.
I think the fixed was in line 80 https://github.com/se-panfilov/vue-notifications/blob/ffdd19cacff28a1692eb9ac4886ff5b5c434c9c2/src/vue-notifications.ts#L80
pluginOptions[methodName]
must be checked if is a function. something like