Skip to content

Commit 1aa9b18

Browse files
authored
Merge pull request #5 from iview/dewyzee/dev
add new example pages
2 parents 5e9079b + 0f50ab6 commit 1aa9b18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4116
-76
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
.DS_Store
99
node_modules/
1010
node_modules2/
11-
dist/
1211
.project
1312
.settings
1413
npm-debug.log

build/build-dev.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const path = require('path')
66
const through2 = require('through2')
77
const gulp = require('gulp')
88
const destDir = getProjectPath('dist')
9+
const exampleDestDir = getProjectPath('examples/src')
910

1011
gulp.task('compile-css', done => {
1112
return gulp
@@ -31,6 +32,7 @@ gulp.task('compile-css', done => {
3132
})
3233
)
3334
.pipe(gulp.dest(destDir))
35+
.pipe(gulp.dest(exampleDestDir))
3436
})
3537

3638
gulp.task('compile-js', () => {
@@ -55,18 +57,21 @@ gulp.task('compile-js', () => {
5557
})
5658
)
5759
.pipe(gulp.dest(destDir))
60+
.pipe(gulp.dest(exampleDestDir))
5861
})
5962

6063
gulp.task('copy-static', () => {
6164
return gulp
6265
.src(['../assets/**/*.@(png|svg|jpg)'])
6366
.pipe(gulp.dest(path.join(destDir, 'assets')))
67+
.pipe(gulp.dest(path.join(exampleDestDir, 'assets')))
6468
})
6569

6670
gulp.task('copy-vue', () => {
6771
return gulp
6872
.src(['../src/components/**/*.vue'])
6973
.pipe(gulp.dest(path.join(destDir, 'components')))
74+
.pipe(gulp.dest(path.join(exampleDestDir, 'components')))
7075
})
7176

7277
gulp.task('auto', () => {

dist/assets/code.jpg

79.7 KB
Loading

dist/assets/iview-weapp.png

186 KB
Loading

dist/assets/logo.png

22.3 KB
Loading

dist/assets/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

dist/components/button/button.vue

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<template>
2+
<div>
3+
<button
4+
class="i-class i-btn"
5+
v-bind:class="classObject"
6+
@click="handleTap"
7+
v-bind:open-type="openType"
8+
v-bind:app-parameter="appParameter"
9+
v-bind:hover-stop-propagation="hoverStopPropagation"
10+
v-bind:hover-start-time="hoverStartTime"
11+
v-bind:hover-stay-time="hoverStayTime"
12+
v-bind:session-from="sessionFrom"
13+
v-bind:send-message-title="sendMessageTitle"
14+
v-bind:send-message-path="sendMessagePath"
15+
v-bind:send-message-img="sendMessageImg"
16+
v-bind:show-message-card="showMessageCard"
17+
@contact="bindcontact"
18+
@getuserinfo="bindgetuserinfo"
19+
@getphonenumber="bindgetphonenumber"
20+
@error="binderror"
21+
plain="true"
22+
>
23+
<div class="i-btn-loading-inner" v-if="loading"></div>
24+
<slot></slot>
25+
</button>
26+
</div>
27+
</template>
28+
29+
<script>
30+
export default {
31+
props: {
32+
type: {
33+
type: String,
34+
default: 'primary',
35+
},
36+
inline: {
37+
type: Boolean,
38+
default: false
39+
},
40+
size: {
41+
type: String,
42+
default: 'default',
43+
},
44+
shape: {
45+
type: String,
46+
default: 'square'
47+
},
48+
disabled: {
49+
type: Boolean,
50+
default: false,
51+
},
52+
loading: {
53+
type: Boolean,
54+
default: false,
55+
},
56+
long: {
57+
type: Boolean,
58+
default: false
59+
},
60+
openType: String,
61+
appParameter: String,
62+
hoverStopPropagation: Boolean,
63+
hoverStartTime: {
64+
type: Number,
65+
default: 20
66+
},
67+
hoverStayTime: {
68+
type: Number,
69+
default: 70
70+
},
71+
lang: {
72+
type: String,
73+
default: 'en'
74+
},
75+
sessionFrom: {
76+
type: String,
77+
default: ''
78+
},
79+
iClass: {
80+
type: String,
81+
default: ''
82+
},
83+
sendMessageTitle: String,
84+
sendMessagePath: String,
85+
sendMessageImg: String,
86+
showMessageCard: Boolean
87+
},
88+
computed: {
89+
classObject: function () {
90+
const btnSize = 'i-btn-' + this.size
91+
const btnType = 'i-btn-' + this.type
92+
const btnShape = 'i-btn-' + this.shape
93+
const btnLong = 'i-btn-' + this.long ? 'long' : ''
94+
const btnLoading = 'i-btn-' + this.loading ? 'loading' : ''
95+
const className = iClass + ' ' + btnSize + ' ' + btnType + ' ' + btnShape + ' '
96+
+ btnLong + ' ' + btnLoading
97+
return className
98+
}
99+
},
100+
methods: {
101+
handleTap (evt) {
102+
if (this.disabled) return false
103+
this.$emit('click', evt)
104+
},
105+
bindgetuserinfo(evt) {
106+
this.$emit('getuserinfo', evt)
107+
},
108+
bindcontact(evt) {
109+
this.$emit('contact', evt)
110+
},
111+
bindgetphonenumber(evt) {
112+
this.$emit('getphonenumber', evt)
113+
},
114+
binderror(evt) {
115+
this.$emit('error', evt)
116+
}
117+
}
118+
}
119+
</script>
120+

dist/components/button/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import iButton from './button.vue'
2+
3+
export default iButton
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
.i-btn {
2+
text-align: center;
3+
vertical-align: middle;
4+
-ms-touch-action: manipulation;
5+
touch-action: manipulation;
6+
cursor: pointer;
7+
background-image: none;
8+
white-space: nowrap;
9+
-webkit-user-select: none;
10+
-moz-user-select: none;
11+
-ms-user-select: none;
12+
user-select: none;
13+
font-size: 14px;
14+
border-radius: 2px;
15+
border: 0 !important;
16+
position: relative;
17+
text-decoration: none;
18+
height: 44px;
19+
line-height: 44px;
20+
-webkit-box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
21+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
22+
color: #fff !important;
23+
background: #f7f7f7 !important;
24+
color: #495060 !important;
25+
margin: 10px;
26+
}
27+
.i-btn-hover {
28+
opacity: 0.9;
29+
}
30+
.i-btn-long {
31+
border-radius: 0;
32+
margin: 0;
33+
-webkit-box-shadow: none;
34+
box-shadow: none;
35+
}
36+
.i-btn-large {
37+
height: 48px;
38+
line-height: 48px;
39+
}
40+
.i-btn-small {
41+
height: 40px;
42+
line-height: 40px;
43+
}
44+
.i-btn-primary {
45+
color: #fff !important;
46+
background: #2d8cf0 !important;
47+
}
48+
.i-btn-ghost {
49+
color: #fff !important;
50+
background: #fff !important;
51+
color: #495060 !important;
52+
}
53+
.i-btn-success {
54+
color: #fff !important;
55+
background: #19be6b !important;
56+
}
57+
.i-btn-warning {
58+
color: #fff !important;
59+
background: #ff9900 !important;
60+
}
61+
.i-btn-error {
62+
color: #fff !important;
63+
background: #ed3f14 !important;
64+
}
65+
.i-btn-info {
66+
color: #fff !important;
67+
background: #2db7f5 !important;
68+
}
69+
.i-btn-circle {
70+
border-radius: 44px;
71+
}
72+
.i-btn-large.i-btn-circle {
73+
border-radius: 48px;
74+
}
75+
.i-btn-small.i-btn-circle {
76+
border-radius: 40px;
77+
}
78+
.i-btn-loading {
79+
opacity: 0.6;
80+
}
81+
.i-btn-loading-inner {
82+
display: inline-block;
83+
margin-right: 12px;
84+
vertical-align: middle;
85+
width: 14px;
86+
height: 14px;
87+
background: transparent;
88+
border-radius: 50%;
89+
border: 2px solid #fff;
90+
border-color: #fff #fff #fff transparent;
91+
-webkit-animation: btn-spin 0.6s linear;
92+
animation: btn-spin 0.6s linear;
93+
-webkit-animation-iteration-count: infinite;
94+
animation-iteration-count: infinite;
95+
}
96+
.i-btn-disabled {
97+
color: #bbbec4 !important;
98+
background: #f7f7f7 !important;
99+
}
100+
.i-btn-inline {
101+
display: inline-block;
102+
}
103+
@-webkit-keyframes btn-spin {
104+
0% {
105+
-webkit-transform: rotate(0);
106+
transform: rotate(0);
107+
}
108+
100% {
109+
-webkit-transform: rotate(360deg);
110+
transform: rotate(360deg);
111+
}
112+
}
113+
@keyframes btn-spin {
114+
0% {
115+
-webkit-transform: rotate(0);
116+
transform: rotate(0);
117+
}
118+
100% {
119+
-webkit-transform: rotate(360deg);
120+
transform: rotate(360deg);
121+
}
122+
}

0 commit comments

Comments
 (0)