Bläddra i källkod

improve according to http://gitlab.alipay-inc.com/ued/ant-design/issues/269

ddcat1115 8 år sedan
förälder
incheckning
ff0385ab2a

+ 1 - 1
src/routes/Forms/BasicForm.js

@@ -178,7 +178,7 @@ export default class BasicForms extends PureComponent {
                 提交
               </Button>
               <Button style={{ marginLeft: 8 }}>保存</Button>
-              <Button style={{ marginLeft: 8 }}>删除</Button>
+              <Button type="danger" style={{ marginLeft: 8 }}>删除</Button>
             </FormItem>
           </Form>
         </Card>

+ 10 - 13
src/routes/List/CardList.js

@@ -1,6 +1,5 @@
 import React, { PureComponent } from 'react';
 import { connect } from 'dva';
-import { Link } from 'dva/router';
 import { Card, Button, Icon, List } from 'antd';
 
 import PageHeaderLayout from '../../layouts/PageHeaderLayout';
@@ -63,18 +62,16 @@ export default class CardList extends PureComponent {
             dataSource={['', ...list]}
             renderItem={item => (item ? (
               <List.Item key={item.id}>
-                <Card className={styles.card} actions={[<a>操作一</a>, <a>操作二</a>]}>
-                  <Link to="/list/card-list">
-                    <Card.Meta
-                      avatar={<img alt="" className={styles.cardAvatar} src={item.avatar} />}
-                      title={item.title}
-                      description={(
-                        <p className={styles.cardDescription}>
-                          <span>{item.description}</span>
-                        </p>
-                      )}
-                    />
-                  </Link>
+                <Card hoverable className={styles.card} actions={[<a>操作一</a>, <a>操作二</a>]}>
+                  <Card.Meta
+                    avatar={<img alt="" className={styles.cardAvatar} src={item.avatar} />}
+                    title={<a href="#">{item.title}</a>}
+                    description={(
+                      <p className={styles.cardDescription}>
+                        <span>{item.description}</span>
+                      </p>
+                    )}
+                  />
                 </Card>
               </List.Item>
               ) : (

+ 9 - 0
src/routes/List/CardList.less

@@ -8,10 +8,18 @@
     :global {
       .ant-card-meta-title {
         margin-bottom: 12px;
+        & > a {
+          color: @heading-color;
+        }
       }
       .ant-card-actions {
         background: #f7f9fa;
       }
+      .ant-card-body:hover {
+        .ant-card-meta-title > a {
+          color: @primary-color;
+        }
+      }
     }
   }
 }
@@ -28,6 +36,7 @@
 .newButton {
   background-color: #fff;
   border-color: @border-color-base;
+  border-radius: @border-radius-sm;
   color: @text-color-secondary;
   width: 100%;
   height: 188px;

+ 3 - 3
src/routes/List/CoverCardList.less

@@ -8,9 +8,9 @@
     :global {
       .ant-card-meta-title {
         margin-bottom: 4px;
-      }
-      .ant-card-meta-title > a {
-        color: @heading-color;
+        & > a {
+          color: @heading-color;
+        }
       }
       .ant-card-meta-description {
         height: 44px;