3.0.40 • Published 5 months ago

intact-react v3.0.40

Weekly downloads
18
License
MIT
Repository
github
Last release
5 months ago

IntactReact

  • 在react 项目中运行intact组件
  • 本项目测试用例使用react 16

使用方式

  1. 引入对应的intact库,intact 组件
  2. 设置Intact 实例别名到IntactReact , 以下为webpack 示例
resolve: {
    alias: {
        'intact$': 'intact-react'
    }
}
import Intact from 'intact';
import React from 'react'
import ReactDOM from 'react-dom'
const h = React.createElement;

class I extends Intact {
    @Intact.template()
    static template = `<div ev-click={self.onClick}>{self.get("children")} child default content {self.get("count")}!</div>`

    onClick(e) {
        const count = this.get('count');
        this.set('count', count + 1);
    }

    defaults() {
        return {
            count: 1
        };
    }
}

class R extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            count: 1
        };
    }

    componentDidMount() {
        console.log(this, 'react componentDidMount')
    }

    click() {
        this.setState({
            count: this.state.count + 1
        })
    }

    render() {
        return h('div', {
            id: 'react',
            onClick: this.click.bind(this)
        }, ['wrap', h(I,{},'this is intact children'), `${this.state.count}`])
    }
}

const container = document.createElement('div');
document.body.appendChild(container);
const component = h(R,{});
ReactDOM.render(
    component,
    container
);

注意

  • intact 对应的 $change:value 使用react props on$change-value,对应的 $changed:value 使用 react props on$changed-value , $change==>on$change $changed==>on$changed
  • 不支持ReactDOMServer , 不支持ReactDOM.hydrate
  • react 添加 block 支持, 例如:<b:block></b:block>对应为React属性b-block, <b:block params="a">对应为React属性b-block={(a) => {}}
3.0.40

5 months ago

3.0.35

1 year ago

3.0.38

10 months ago

3.0.39

10 months ago

3.0.36

1 year ago

3.0.37

1 year ago

3.0.34

1 year ago

3.0.33

1 year ago

3.0.32

1 year ago

3.0.31

1 year ago

3.0.30

1 year ago

3.0.29

1 year ago

3.0.27

1 year ago

3.0.28

1 year ago

3.0.26

1 year ago

3.0.25

1 year ago

3.0.24

1 year ago

3.0.23

2 years ago

3.0.21

2 years ago

3.0.22

2 years ago

3.0.20

2 years ago

3.0.19

2 years ago

3.0.18

2 years ago

3.0.17

2 years ago

3.0.16

2 years ago

3.0.14

2 years ago

3.0.15

2 years ago

3.0.13

2 years ago

3.0.12

3 years ago

3.0.10

3 years ago

3.0.11

3 years ago

3.0.9

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.4

3 years ago

3.0.0-beta.23

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

3.0.0-beta.21

3 years ago

3.0.0-beta.22

3 years ago

3.0.0-beta.20

3 years ago

1.1.34

3 years ago

3.0.0-beta.19

3 years ago

1.1.33

4 years ago

3.0.0-beta.16

4 years ago

3.0.0-beta.17

3 years ago

3.0.0-beta.18

3 years ago

1.1.32

4 years ago

3.0.0-beta.14

4 years ago

3.0.0-beta.15

4 years ago

3.0.0-beta.13

4 years ago

3.0.0-beta.12

4 years ago

1.1.31

4 years ago

1.1.30

5 years ago

1.1.29

5 years ago

1.1.28

5 years ago

1.1.27

5 years ago

1.1.26

5 years ago

1.1.25

5 years ago

1.1.24

5 years ago

1.1.23

6 years ago

1.1.22

6 years ago

1.1.21

6 years ago

1.1.20

6 years ago

1.1.19

6 years ago

1.1.18

6 years ago

1.1.17

6 years ago

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago