Browse Source

修改上次用药图标显示方式

zhangxc 6 năm trước cách đây
mục cha
commit
7fb7be2253

+ 3 - 3
src/components/Treat/DrugHistory/LastDrug/index.jsx

@@ -15,9 +15,9 @@ class LastDrug extends Component {
         this.setDrugInfo = this.setDrugInfo.bind(this);
     }
     handleMouseEnterDrug(index, item) {
-        const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
-        const imgLeft = drugNameWidth/2-8
-        $('#'+item.id).find('img').css('left', imgLeft)
+        // const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
+        // const imgLeft = drugNameWidth/2-8
+        // $('#'+item.id).find('img').css('left', imgLeft)
         this.setState({
             currentIndex: index,
         })

+ 2 - 1
src/components/Treat/DrugHistory/LastDrug/index.less

@@ -17,6 +17,7 @@
 .info-img {
     position: absolute;
     width: 15px;
-    position: absolute;
     top: -8px;
+    left: 50%;
+    margin-left: -7px;
 }