-
Notifications
You must be signed in to change notification settings - Fork 644
Deprecation: w‐config
Taylor Hunt edited this page Aug 2, 2019
·
1 revision
getWidgetConfig
and the w-config
attribute are deprecated. Marko now provides this.input
in the onMount
method, which has a similar effect.
init
is renamed to onMount
, which better describes when it’s called in a component’s lifecycle. getWidgetConfig
is no longer necessary (or even called), and w-config
is ignored because we can access this.input
inside onMount
.
// index.js
init(config) {
$(this.el).dataTable(config);
}
// template.marko
<table w-bind w-config={
paginate: input.paginate,
scrollY: input.scrollY
}>
…become:
// component.js
onMount() {
$(this.el).dataTable({
paginate: this.input.paginate,
scrollY: this.input.scrollY
});
}
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.