Skip to content

Commit

Permalink
fix: add el to custom tag render function
Browse files Browse the repository at this point in the history
  • Loading branch information
whxaxes committed Nov 18, 2018
1 parent b991b23 commit 82d2eae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/compile/compile.js
Expand Up @@ -122,6 +122,7 @@ class Compiler {
attr,
Object.assign({}, scope),
{
el,
fileUrl: el._ast.fileUrl,
include,
compile: this.processAst.bind(this),
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.js
Expand Up @@ -482,8 +482,8 @@ describe('lib#index', () => {
const mus = new Mus();
mus.setTag('style', {
noAttr: true,
render(attr, scope, compiler) {
return `<style>${compiler.compile(this.children, scope)}</style>`
render(attr, scope, { compile, el }) {
return `<style>${compile(el.children, scope)}</style>`
}
});

Expand Down

0 comments on commit 82d2eae

Please sign in to comment.