Browse Source

层级变更切换key绑定位置

master
jiannibang 6 years ago
parent
commit
21e57ffd27
  1. 4
      src/App.js
  2. 2
      src/App.scss

4
src/App.js

@ -162,11 +162,11 @@ const App = () => {
{list.map(([key, el]) => ( {list.map(([key, el]) => (
<div <div
className="block-wrapper" className="block-wrapper"
style={{ ...el.style, backgroundImage: "nonde" }}
key={key}
style={{ ...el.style, backgroundImage: "none" }}
> >
<div <div
className="block" className="block"
key={key}
style={{ backgroundImage: el.style.backgroundImage }} style={{ backgroundImage: el.style.backgroundImage }}
onClick={(e) => { onClick={(e) => {
if (!itemData) { if (!itemData) {

2
src/App.scss

@ -21,7 +21,7 @@
} }
.block-wrapper { .block-wrapper {
position: absolute; position: absolute;
border: 1px solid rgb(224, 224, 224);
// border: 1px solid rgb(224, 224, 224);
opacity: 1; opacity: 1;
padding: 8px 10px; padding: 8px 10px;
box-sizing: border-box; box-sizing: border-box;

Loading…
Cancel
Save