Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
fix: render no exprot and html test
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed Jul 16, 2017
1 parent d482619 commit 133af07
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/zreact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { cloneElement } from "./clone-element";
import { Component } from "./component";
import { h, h as createElement } from "./h";
import options from "./options";
import { render } from "./render";

export default {
Component,
cloneElement,
createElement,
h,
options,
render,
};

export {
Expand All @@ -17,4 +19,5 @@ export {
createElement,
h,
options,
render,
};
22 changes: 22 additions & 0 deletions test/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="../dist/zreact.js"></script>
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script>
function test() {
console.log('_______')
}
Zreact.render(
Zreact.h("h1", { "onClick": test }, "test"),
document.querySelector("#app")
);
</script>
</body>
</html>
13 changes: 10 additions & 3 deletions test/test.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { h } from '../dist/zreact'
import { h, Component } from '../dist/zreact'

class App {

class App extends Component {
test() {
console.log('----')
}
render() {
return <h1>testApp</h1>
return <h1 onClick={ this.test }></h1>
}
}

const test = {
test() {
console.log('-----')
},
render() {
return <div>
<App/>
Expand Down

0 comments on commit 133af07

Please sign in to comment.