3.0.34 • Published 1 month ago

intact-react v3.0.34

Weekly downloads
18
License
MIT
Repository
github
Last release
1 month 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.34

1 month ago

3.0.33

2 months ago

3.0.32

3 months ago

3.0.31

3 months ago

3.0.30

3 months ago

3.0.29

4 months ago

3.0.27

4 months ago

3.0.28

4 months ago

3.0.26

4 months ago

3.0.25

5 months ago

3.0.24

5 months ago

3.0.23

5 months ago

3.0.21

6 months ago

3.0.22

6 months ago

3.0.20

6 months ago

3.0.19

7 months ago

3.0.18

9 months ago

3.0.17

9 months ago

3.0.16

1 year ago

3.0.14

1 year ago

3.0.15

1 year ago

3.0.13

1 year ago

3.0.12

1 year ago

3.0.10

2 years ago

3.0.11

1 year ago

3.0.9

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.0-beta.23

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

3.0.0-beta.21

2 years ago

3.0.0-beta.22

2 years ago

3.0.0-beta.20

2 years ago

1.1.34

2 years ago

3.0.0-beta.19

2 years ago

1.1.33

2 years ago

3.0.0-beta.16

2 years ago

3.0.0-beta.17

2 years ago

3.0.0-beta.18

2 years ago

1.1.32

3 years ago

3.0.0-beta.14

3 years ago

3.0.0-beta.15

3 years ago

3.0.0-beta.13

3 years ago

3.0.0-beta.12

3 years ago

1.1.31

3 years ago

1.1.30

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

5 years ago

1.1.21

5 years ago

1.1.20

5 years ago

1.1.19

5 years ago

1.1.18

5 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago