Skip to content

Commit

Permalink
fix: fixed $restArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
kobezzza committed Dec 7, 2023
1 parent e0b5145 commit 968dda8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/snakeskin/default-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function tagFilter({name, attrs = {}}, tplName, cursor) {
}

attrs[':getRoot'] = ["() => ('getRoot' in self ? self.getRoot?.() : null) ?? self.$root"];
attrs[':getParent'] = ["() => 'typeof $restArgs !== 'undefined' ? $restArgs.ctx : self"];
attrs[':getParent'] = ["() => typeof $restArgs !== 'undefined' ? $restArgs?.ctx ?? self : self"];

if (component.inheritMods !== false && !attrs[':modsProp']) {
attrs[':modsProp'] = ['sharedMods'];
Expand Down
3 changes: 3 additions & 0 deletions src/core/component/init/states/before-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export function beforeCreateState(
unsafe.$modifiedFields = {};
unsafe.$renderCounter = 0;

// A stub for the correct functioning of $parent
unsafe.$restArgs = undefined;

unsafe.async = new Async(component);
unsafe.$async = new Async(component);

Expand Down

0 comments on commit 968dda8

Please sign in to comment.