Skip to content

Commit

Permalink
#434 ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
errorrik committed Aug 21, 2019
1 parent 65b1146 commit 1696ba9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/view/compile-expr-source.js
Expand Up @@ -296,6 +296,9 @@ var compileExprSource = {

case ExprType.CALL:
return compileExprSource.callExpr(expr);

case ExprType.NULL:
return 'null';
}
}
};
Expand Down
6 changes: 6 additions & 0 deletions test/ssr/null-expr/component.js
@@ -0,0 +1,6 @@
var san = require('../../../dist/san.ssr');
var MyComponent = san.defineComponent({
template: '<a><b s-if="nullValue === null">b</b></a>'
});

exports = module.exports = MyComponent;
1 change: 1 addition & 0 deletions test/ssr/null-expr/data.js
@@ -0,0 +1 @@
exports = module.exports = { nullValue: null };
Empty file added test/ssr/null-expr/result.html
Empty file.
8 changes: 8 additions & 0 deletions test/ssr/null-expr/spec.js
@@ -0,0 +1,8 @@
it("null", function () {
// [inject] init

expect(wrap.getElementsByTagName('b').length).toBe(1);

myComponent.dispose();
document.body.removeChild(wrap);
});

0 comments on commit 1696ba9

Please sign in to comment.