Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dntzhang authored Feb 13, 2017
1 parent 39d11c3 commit 3bc4367
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion transformjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,55 @@ domElement.originX = 0.5;
//console.log(domElement.translateX )
```

### Omi Version:

* [omi-transform](https://github.com/AlloyTeam/omi/tree/master/plugins/omi-transform)
* [demo](http://alloyteam.github.io/omi/plugins/omi-transform/example/transform/)

```js
import Omi from 'omi';
import OmiTransform from '../../omi-transform.js';

OmiTransform.init();

class App extends Omi.Component {
constructor(data) {
super(data);
}

installed(){
setInterval(function(){
this.refs.test.rotateZ += 0.1;
}.bind(this));
}

render() {
return `
<div omi-transform class="test" ref="test" rotateZ="45" translateX="100" >
omi-transform
</div>
`;
}

style(){
return `
.test{
font-size: 20px;
border: 1px solid red;
width: 150px;
font-size
min-height: 150px;
text-align: center;
line-height:150px;
}
`;
}
}

Omi.render(new App(),"#container");
```

### React Version:

```js
Expand Down Expand Up @@ -69,4 +118,4 @@ render() {
```

# License
This content is released under the [MIT](http://opensource.org/licenses/MIT) License.
This content is released under the [MIT](http://opensource.org/licenses/MIT) License.

0 comments on commit 3bc4367

Please sign in to comment.