Skip to content

Commit 965d9d3

Browse files
committed
refactoe: 优化 button 代码
1 parent 12a901a commit 965d9d3

File tree

7 files changed

+14
-42
lines changed

7 files changed

+14
-42
lines changed
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
/**
2-
* kouchao 创建于 2018/8/27
3-
*/
4-
5-
import LayButtonContainer from '../button/src/btn-container';
1+
import ButtonContainer from '../button/src/button-container';
62

73
/* istanbul ignore next */
8-
LayButtonContainer.install = function (Vue) {
9-
Vue.component(LayButtonContainer.name, LayButtonContainer);
4+
ButtonContainer.install = function (Vue) {
5+
Vue.component(ButtonContainer.name, ButtonContainer);
106
};
117

12-
export default LayButtonContainer;
8+
export default ButtonContainer;

src/components/button-group/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
/**
2-
* kouchao 创建于 2018/8/27
3-
*/
4-
5-
import LayButtonGroup from '../button/src/btn-group';
1+
import ButtonGroup from '../button/src/button-group';
62

73
/* istanbul ignore next */
8-
LayButtonGroup.install = function (Vue) {
9-
Vue.component(LayButtonGroup.name, LayButtonGroup);
4+
ButtonGroup.install = function (Vue) {
5+
Vue.component(ButtonGroup.name, ButtonGroup);
106
};
117

12-
export default LayButtonGroup;
8+
export default ButtonGroup;

src/components/button/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
/**
2-
* kouchao 创建于 2018/8/27
3-
*/
4-
5-
import LayBtn from './src/btn';
1+
import Button from './src/button';
62

73
/* istanbul ignore next */
8-
LayBtn.install = function (Vue) {
9-
Vue.component(LayBtn.name, LayBtn);
4+
Button.install = function (Vue) {
5+
Vue.component(Button.name, Button);
106
};
117

12-
export default LayBtn;
8+
export default Button;

src/components/button/src/btn-container.vue renamed to src/components/button/src/button-container.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ export default {
99
name: 'LayButtonContainer'
1010
};
1111
</script>
12-
13-
<style scoped></style>

src/components/button/src/btn-group.vue renamed to src/components/button/src/button-group.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,3 @@ export default {
99
name: 'LayButtonGroup'
1010
};
1111
</script>
12-
13-
<style scoped>
14-
i.left {
15-
padding-right: 5px;
16-
}
17-
i.right {
18-
padding-left: 5px;
19-
}
20-
</style>

src/components/button/src/btn.vue renamed to src/components/button/src/button.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
v-if="icon && right"
2626
class="right"
2727
:class="icon"
28-
/></a>
28+
/>
29+
</a>
2930

3031
<button
3132
v-else

src/components/col/src/col.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ export default {
2626
type: Number,
2727
default: 0
2828
},
29-
xl: {
30-
type: Number,
31-
default: 0
32-
},
3329
offset: {
3430
type: Number,
3531
default: 0
@@ -55,5 +51,3 @@ export default {
5551
}
5652
};
5753
</script>
58-
59-
<style></style>

0 commit comments

Comments
 (0)