Browse Source

Fix conflict

qingwei.li 8 năm trước cách đây
mục cha
commit
a8df9de2ee

+ 1 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@
 
 - 修复 Tabs 切换后 Tab-panel 被销毁的问题
 - 修复 TimePicker 错误的隐藏面板
+- 修复 Table Cell 的样式, #204
 
 ### 1.0.0-rc.5
 

+ 22 - 0
packages/button/src/button-group.js

@@ -0,0 +1,22 @@
+/**
+ * button
+ * @module components/basic/menu
+ * @desc 用于按钮组
+ * @param {string} label - 名称
+ */
+export default {
+  name: 'ElButtonGroup',
+
+  functional: true,
+
+  render(h, { slots, data }) {
+    return (
+      <div
+        class="el-button-group"
+        { ...data }
+        { ...{ on: data.nativeOn } }>
+        { slots().default }
+      </div>
+    );
+  }
+};

+ 0 - 16
packages/button/src/button-group.vue

@@ -1,16 +0,0 @@
-<template>
-  <div class="el-button-group">
-    <slot></slot>
-  </div>
-</template>
-<script>
-  /**
-   * button
-   * @module components/basic/menu
-   * @desc 用于按钮组
-   * @param {string} label - 名称
-   */
-  export default {
-    name: 'ElButtonGroup'
-  };
-</script>

+ 65 - 0
packages/button/src/button.js

@@ -0,0 +1,65 @@
+export default {
+  name: 'ElButton',
+
+  functional: true,
+
+  props: {
+    type: {
+      type: String,
+      default: 'default'
+    },
+    size: String,
+    icon: {
+      type: String,
+      default: ''
+    },
+    nativeType: {
+      type: String,
+      default: 'button'
+    },
+    loading: {
+      type: Boolean,
+      default: false
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    plain: {
+      type: Boolean,
+      default: false
+    }
+  },
+
+  render(h, { props, slots, data }) {
+    return (
+      <button
+        disabled={ props.disabled }
+        type={ props.nativeType }
+        class={[
+          'el-button',
+          props.type ? 'el-button-' + props.type : '',
+          props.size ? 'el-button-' + props.size : '',
+          {
+            'is-disabled': props.disabled,
+            'is-loading': props.loading,
+            'is-plain': props.plain
+          }
+        ]}
+        { ...data }
+        { ...{ on: data.nativeOn } }>
+        {
+          [
+            props.loading
+              ? <i class="el-icon-loading"></i>
+              : {},
+            props.icon && !props.loading
+              ? <i class={ 'el-icon-' + props.icon }></i>
+              : {}
+          ]
+        }
+        { slots().default }
+      </button>
+    );
+  }
+};

+ 0 - 54
packages/button/src/button.vue

@@ -1,54 +0,0 @@
-<template>
-  <button :disabled="disabled" class="el-button"
-    :type="nativeType"
-    :class="[
-      type ? 'el-button-' + type : '',
-      size ? 'el-button-' + size : '',
-      {
-        'is-disabled': disabled,
-        'is-loading': loading,
-        'is-plain': plain
-      }
-    ]"
-  >
-    <i class="el-icon-loading" v-if="loading"></i>
-    <i :class="'el-icon-' + icon" v-if="icon && !loading"></i>
-    <slot></slot>
-  </button>
-</template>
-<script>
-  /**
-   * button
-   */
-  export default {
-    name: 'ElButton',
-
-    props: {
-      type: {
-        type: String,
-        default: 'default'
-      },
-      size: String,
-      icon: {
-        type: String,
-        default: ''
-      },
-      nativeType: {
-        type: String,
-        default: 'button'
-      },
-      loading: {
-        type: Boolean,
-        default: false
-      },
-      disabled: {
-        type: Boolean,
-        default: false
-      },
-      plain: {
-        type: Boolean,
-        default: false
-      }
-    }
-  };
-</script>

+ 1 - 1
packages/icon/index.js

@@ -1 +1 @@
-module.exports = require('./src/icon.vue');
+module.exports = require('./src/icon');

+ 19 - 0
packages/icon/src/icon.js

@@ -0,0 +1,19 @@
+export default {
+  name: 'ElIcon',
+
+  functional: true,
+
+  props: {
+    name: String
+  },
+
+  render(h, { props, data }) {
+    return (
+      <i
+        class={ 'el-icon' + props.name }
+        { ...data }
+        { ...{ on: data.nativeOn } }>
+      </i>
+    );
+  }
+};

+ 0 - 13
packages/icon/src/icon.vue

@@ -1,13 +0,0 @@
-<template>
-  <i :class="'el-icon-' + name"></i>
-</template>
-
-<script>
-  export default {
-    name: 'ElIcon',
-
-    props: {
-      name: String
-    }
-  };
-</script>

+ 1 - 6
packages/theme-default/src/table.css

@@ -50,6 +50,7 @@
 
     & th {
       white-space: nowrap;
+      overflow: hidden;
     }
 
     & th, td {
@@ -57,7 +58,6 @@
       max-width: 250px;
       min-width: 0;
       box-sizing: border-box;
-      overflow: hidden;
       text-overflow: ellipsis;
       vertical-align: middle;
       position: relative;
@@ -102,10 +102,6 @@
       box-sizing: border-box;
     }
 
-    & td div {
-      display: block;
-    }
-
     @e fixed {
       position: absolute;
       top: 0;
@@ -180,7 +176,6 @@
     & th > .cell {
       position: relative;
       word-wrap: normal;
-      overflow: hidden;
       text-overflow: ellipsis;
       display: inline-block;
       line-height: 20px;