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

在ie11浏览器上控制台报错 #28

Open
azz1123 opened this issue Sep 3, 2018 · 4 comments
Open

在ie11浏览器上控制台报错 #28

azz1123 opened this issue Sep 3, 2018 · 4 comments

Comments

@azz1123
Copy link

azz1123 commented Sep 3, 2018

The above error occurred in one of your React components:
in div (at Dragact.js:43)
in Unknown
in Unknown
in div
in Unknown (at Dragact.js:27)
in Unknown (at App.js:48)
in div (at App.js:35)
in Unknown (at index.js:7)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.

'use strict'
import React from 'react';

import {Dragact} from 'dragact'

import styles from './Dragact.scss';

class DragactDemo extends React.Component {
  constructor(props) {
    super(props);

  }

  getblockStyle = (isDragging) => {
    console.log("isDragging", isDragging)
    return {
      background: isDragging ? '#ccc' : 'wheat'
    }
  }

  getLayout = (item, provided) => {
    console.log('item', item, provided)
  };

  render() {
    return (
      <Dragact
        layout={fakeData}
        col={1}
        rowHeight={40}
        margin={[15, 5]}
        padding={10}
        className='plant-layout'
        style={{background: "rgb(247, 221, 255)"}}
        canResize={true}
        onDragEnd={(item, provided) => this.getLayout(item, provided)}
      >
        {(item, provided) => {
          const blockStyle = this.getblockStyle(provided.isDragging);
          const styleDiv = Object.assign({}, provided.props.style, blockStyle, {width: ` calc(100% - 30px)`});
          console.log('styleDiv', provided, blockStyle, styleDiv)
          return (
            <div {...provided.props} {...provided.dragHandle} style={styleDiv}>
              {provided.isDragging ? '正在抓取' : '停放'}{item.key}
            </div>
          )
        }}
      </Dragact>
    );
  }
}

export default DragactDemo;


const fakeData = [
  {GridX: 0, GridY: 0, w: 1, h: 2, key: "0"},
  {GridX: 0, GridY: 0, w: 1, h: 2, key: "1"},
  {GridX: 0, GridY: 0, w: 1, h: 2, key: "2"},
  {GridX: 0, GridY: 0, w: 1, h: 2, key: "3"},
];
@Foveluy
Copy link
Owner

Foveluy commented Sep 3, 2018

@azz1123 有点奇妙,我去复现一下

@azz1123
Copy link
Author

azz1123 commented Sep 7, 2018

@Foveluy 复现了吗

@huhaoyang
Copy link

@azz1123 解决了吗

@MINGXINICE
Copy link

请问IE11的问题解决了吗

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

4 participants