Skip to content

Commit

Permalink
组件源码
Browse files Browse the repository at this point in the history
仅用学习使用,切勿用于生产环境,有问题,请自行解决
  • Loading branch information
AntJavascript committed Oct 5, 2018
1 parent 072392b commit f724d12
Show file tree
Hide file tree
Showing 70 changed files with 19,276 additions and 0 deletions.
69 changes: 69 additions & 0 deletions ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<template>
<div class='wt-actionButton' :class="className" :style="{zIndex: zIndex, bottom:bottom + 'rem', right:right + 'rem'}">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'wt-actionButton',
props: {
type: {
type: String,
default: () => {
return '';
}
},
zIndex: {
type: String | Number,
default: () => {
return 100;
}
},
bottom: {
type: String | Number,
default: () => {
return 2.8;
}
},
right: {
type: String | Number,
default: () => {
return 0.5;
}
}
},
computed: {
// 拼接class
className: function () {
return this.type;
}
},
methods: {}
};
</script>
<style lang='less' rel='stylesheet/less' scoped>
.wt-actionButton {
position: fixed;
width: 2.4rem;
height: 2.4rem;
border-radius: 2.2rem;
background: #fff;
box-sizing: border-box;
&.primary {
background: #1BB5F1;
color:#fff;
border: 0;
&:active {
background: #62c3e9;
}
}
&.danger {
background: #ef4f4f;
color:#fff;
border: 0;
&:active {
background: #ff6969;
}
}
}
</style>
24 changes: 24 additions & 0 deletions Align/Align.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class='wt-align'>
<slot></slot>
</div>
</template>
<script>
export default {
name: 'wt-align',
props: {},
data () {
return {
};
},
methods: {}
};
</script>
<style lang='less' rel='stylesheet/less' scoped>
.wt-align {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
34 changes: 34 additions & 0 deletions BoxSize/BoxSize.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div class='wt-box-size' :style="{width: width + 'rem',height: height + 'rem'}">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'wt-boxSize',
props: {
width: {
type: String | Number,
default: () => {
return 0;
}
},
height: {
type: String | Number,
default: () => {
return 0;
}
}
},
data () {
return {
};
},
methods: {}
};
</script>
<style lang='less' rel='stylesheet/less' scoped>
.wt-box-size {
overflow: hidden;
}
</style>
99 changes: 99 additions & 0 deletions Button/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<template>
<div class="wt-button" :class="className()">
<i :class="icon" v-if="icon"></i>
{{title}}
</div>
</template>
<script>
export default {
name: 'wt-button',
props: {
title: {
type: String,
default: () => {
return 'button';
}
},
icon: {
type: String,
default: () => {
return '';
}
},
type: {
type: String,
default: () => {
return 'default';
}
},
size: {
type: String,
default: () => {
return 'normal';
}
}
},
data () {
return {};
},
methods: {
// 拼接class
className () {
return this.type + ' ' + this.size;
}
}
};
</script>
<style lang="less" rel="stylesheet/less" scoped>
.wt-button {
background: #fff;
color: #333;
border: 1px solid #eee;
text-align: center;
border-radius: 0.2rem;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
i {
margin: 0 0.2rem;
}
&:active {
background: #eee;
}
&.primary {
background: #1BB5F1;
color:#fff;
border: 0;
&:active {
background: #62c3e9;
}
}
&.danger {
background: #ef4f4f;
color:#fff;
border: 0;
&:active {
background: #ff6969;
}
}
&.normal {
height: 2rem;
line-height: 2rem;
font-size: 0.8rem;
width: 50%;
}
&.small {
height: 1.5rem;
line-height: 1.5rem;
font-size: 0.7rem;
width: 30%;
}
&.large {
height: 2.5rem;
line-height: 2.5rem;
font-size: 0.9rem;
width: 100%;
}
}
</style>
Loading

0 comments on commit f724d12

Please sign in to comment.