Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegisterBehaviour组件报错:TypeError: page.behaviourOn is not a function #78

Closed
Yeung2017 opened this issue Oct 11, 2018 · 0 comments

Comments

@Yeung2017
Copy link

问题描述:
image

相关代码:

// 库引入
import React, {Component} from 'react';
import { RegisterBehaviour } from 'gg-editor';

class RegisterProcessMouseEnterFillRedBehaviour extends Component {
  mouseEnterFillRed = page =>{
    page.behaviourOn('node:mouseenter', ev=>{
      console.log('node:mouseenter');
      page.update(ev.item, {
        color: 'red'
      });
    });
  };
  render() {
    return (
      <RegisterBehaviour name="mouseEnterFillRed" behaviour={this.mouseEnterFillRed} />
    );
  }
}

RegisterProcessMouseEnterFillRedBehaviour.defaultProps = {
};

export {
  RegisterProcessMouseEnterFillRedBehaviour,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants