@mpxjs/webpack-plugin 2.9.69 → 2.9.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parser.js +1 -1
- package/lib/platform/json/wx/index.js +21 -8
- package/lib/platform/style/wx/index.js +51 -54
- package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
- package/lib/platform/template/wx/component-config/index.js +1 -1
- package/lib/platform/template/wx/component-config/input.js +1 -1
- package/lib/platform/template/wx/component-config/rich-text.js +8 -0
- package/lib/platform/template/wx/component-config/swiper.js +1 -1
- package/lib/platform/template/wx/component-config/textarea.js +1 -1
- package/lib/platform/template/wx/component-config/unsupported.js +1 -1
- package/lib/react/processTemplate.js +3 -0
- package/lib/runtime/components/react/context.ts +4 -0
- package/lib/runtime/components/react/dist/context.js +1 -0
- package/lib/runtime/components/react/dist/event.config.js +24 -24
- package/lib/runtime/components/react/dist/getInnerListeners.js +183 -166
- package/lib/runtime/components/react/dist/mpx-button.jsx +35 -42
- package/lib/runtime/components/react/dist/mpx-canvas/html.js +2 -4
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +35 -13
- package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +13 -19
- package/lib/runtime/components/react/dist/mpx-checkbox.jsx +29 -38
- package/lib/runtime/components/react/dist/mpx-form.jsx +16 -19
- package/lib/runtime/components/react/dist/mpx-icon.jsx +8 -16
- package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +54 -27
- package/lib/runtime/components/react/dist/mpx-label.jsx +15 -22
- package/lib/runtime/components/react/dist/mpx-movable-area.jsx +13 -16
- package/lib/runtime/components/react/dist/mpx-movable-view.jsx +13 -13
- package/lib/runtime/components/react/dist/mpx-navigator.jsx +2 -4
- package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
- package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +3 -1
- package/lib/runtime/components/react/dist/mpx-picker-view.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-radio-group.jsx +11 -19
- package/lib/runtime/components/react/dist/mpx-radio.jsx +27 -42
- package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.jsx +6 -4
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +47 -41
- package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
- package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +4 -2
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +4 -2
- package/lib/runtime/components/react/dist/mpx-switch.jsx +20 -10
- package/lib/runtime/components/react/dist/mpx-text.jsx +11 -10
- package/lib/runtime/components/react/dist/mpx-textarea.jsx +8 -3
- package/lib/runtime/components/react/dist/mpx-view.jsx +34 -46
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +105 -42
- package/lib/runtime/components/react/dist/useAnimationHooks.js +35 -10
- package/lib/runtime/components/react/dist/utils.jsx +107 -82
- package/lib/runtime/components/react/event.config.ts +25 -26
- package/lib/runtime/components/react/getInnerListeners.ts +238 -188
- package/lib/runtime/components/react/mpx-button.tsx +64 -50
- package/lib/runtime/components/react/mpx-canvas/html.ts +2 -4
- package/lib/runtime/components/react/mpx-canvas/index.tsx +46 -48
- package/lib/runtime/components/react/mpx-checkbox-group.tsx +28 -25
- package/lib/runtime/components/react/mpx-checkbox.tsx +48 -49
- package/lib/runtime/components/react/mpx-form.tsx +25 -28
- package/lib/runtime/components/react/mpx-icon.tsx +12 -17
- package/lib/runtime/components/react/mpx-image.tsx +436 -0
- package/lib/runtime/components/react/mpx-input.tsx +77 -57
- package/lib/runtime/components/react/mpx-label.tsx +26 -27
- package/lib/runtime/components/react/mpx-movable-area.tsx +18 -23
- package/lib/runtime/components/react/mpx-movable-view.tsx +21 -25
- package/lib/runtime/components/react/mpx-navigator.tsx +2 -8
- package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
- package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
- package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
- package/lib/runtime/components/react/mpx-picker-view-column.tsx +4 -1
- package/lib/runtime/components/react/mpx-picker-view.tsx +7 -1
- package/lib/runtime/components/react/mpx-radio-group.tsx +24 -27
- package/lib/runtime/components/react/mpx-radio.tsx +45 -54
- package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +121 -0
- package/lib/runtime/components/react/mpx-root-portal.tsx +3 -5
- package/lib/runtime/components/react/mpx-scroll-view.tsx +72 -71
- package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
- package/lib/runtime/components/react/mpx-swiper/carouse.tsx +4 -2
- package/lib/runtime/components/react/mpx-swiper-item.tsx +3 -2
- package/lib/runtime/components/react/mpx-switch.tsx +29 -23
- package/lib/runtime/components/react/mpx-text.tsx +14 -18
- package/lib/runtime/components/react/mpx-textarea.tsx +11 -10
- package/lib/runtime/components/react/mpx-view.tsx +55 -65
- package/lib/runtime/components/react/mpx-web-view.tsx +108 -63
- package/lib/runtime/components/react/types/global.d.ts +3 -17
- package/lib/runtime/components/react/useAnimationHooks.ts +36 -12
- package/lib/runtime/components/react/utils.tsx +113 -82
- package/lib/runtime/components/web/getInnerListeners.js +6 -6
- package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
- package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
- package/lib/runtime/components/web/mpx-picker.vue +382 -385
- package/lib/runtime/components/web/mpx-web-view.vue +175 -161
- package/lib/runtime/optionProcessor.js +7 -38
- package/lib/runtime/utils.js +2 -0
- package/lib/style-compiler/plugins/scope-id.js +30 -2
- package/lib/template-compiler/bind-this.js +7 -2
- package/lib/template-compiler/compiler.js +77 -46
- package/lib/template-compiler/gen-node-react.js +2 -2
- package/lib/utils/pre-process-json.js +9 -5
- package/package.json +5 -4
- package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
- package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
- package/lib/runtime/components/react/mpx-image/index.tsx +0 -345
- package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
- package/lib/runtime/components/web/event.js +0 -105
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
<div class="wheel-wrapper" ref="wheelWrapper">
|
|
18
18
|
<div class="wheel" v-for="(data, index) in pickerData" :key="index">
|
|
19
19
|
<ul class="wheel-scroll">
|
|
20
|
-
<li
|
|
21
|
-
v-for="item in data" :key="item"
|
|
22
|
-
class="wheel-item">{{item}}
|
|
20
|
+
<li v-for="item in data" :key="item" class="wheel-item">{{ item }}
|
|
23
21
|
</li>
|
|
24
22
|
</ul>
|
|
25
23
|
</div>
|
|
@@ -34,453 +32,451 @@
|
|
|
34
32
|
|
|
35
33
|
|
|
36
34
|
<script type="text/ecmascript-6">
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
import BScroll from '@better-scroll/core'
|
|
36
|
+
import Wheel from '@better-scroll/wheel'
|
|
37
|
+
import { type, extend } from '../../utils'
|
|
38
|
+
import { getCustomEvent } from './getInnerListeners'
|
|
39
|
+
|
|
40
|
+
const startYear = 1900
|
|
41
|
+
const modeOptions = {
|
|
42
|
+
time: [23, 59],
|
|
43
|
+
date: [200, 11, 30]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
BScroll.use(Wheel)
|
|
47
|
+
|
|
48
|
+
function getPickerData (range, rangeKey) {
|
|
49
|
+
if (range) {
|
|
50
|
+
return range.map((item) => {
|
|
51
|
+
if (rangeKey && type(item) === 'Object') {
|
|
52
|
+
return item[rangeKey]
|
|
53
|
+
}
|
|
54
|
+
return item
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
return range
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getTimePickerData () {
|
|
61
|
+
let list = []
|
|
62
|
+
for (let i = 0; i < 60; i++) {
|
|
63
|
+
let temp = i < 10 ? `0${i}` : i
|
|
64
|
+
list.push(temp)
|
|
46
65
|
}
|
|
66
|
+
return [list.slice(0, 24), list]
|
|
67
|
+
}
|
|
47
68
|
|
|
48
|
-
|
|
69
|
+
function getDatePickerData (fields) {
|
|
70
|
+
let years = []
|
|
71
|
+
let months = []
|
|
72
|
+
let days = []
|
|
49
73
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return range.map((item) => {
|
|
53
|
-
if (rangeKey && type(item) === 'Object') {
|
|
54
|
-
return item[rangeKey]
|
|
55
|
-
}
|
|
56
|
-
return item
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
return range
|
|
74
|
+
for (let i = 0; i <= 200; i++) {
|
|
75
|
+
years.push(`${startYear + i}年`)
|
|
60
76
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
let list = []
|
|
64
|
-
for (let i = 0; i < 60; i++) {
|
|
65
|
-
let temp = i < 10 ? `0${i}` : i
|
|
66
|
-
list.push(temp)
|
|
67
|
-
}
|
|
68
|
-
return [list.slice(0, 24), list]
|
|
77
|
+
if (fields === 'year') {
|
|
78
|
+
return [years]
|
|
69
79
|
}
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
years.push(`${startYear + i}年`)
|
|
78
|
-
}
|
|
79
|
-
if (fields === 'year') {
|
|
80
|
-
return [years]
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
for (let i = 1; i <= 12; i++) {
|
|
84
|
-
let temp = i < 10 ? `0${i}` : i
|
|
85
|
-
months.push(`${temp}月`)
|
|
86
|
-
}
|
|
87
|
-
if (fields === 'month') {
|
|
88
|
-
return [years, months]
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
for (let i = 1; i <= 31; i++) {
|
|
92
|
-
let temp = i < 10 ? `0${i}` : i
|
|
93
|
-
days.push(`${temp}日`)
|
|
94
|
-
}
|
|
95
|
-
return [years, months, days]
|
|
81
|
+
for (let i = 1; i <= 12; i++) {
|
|
82
|
+
let temp = i < 10 ? `0${i}` : i
|
|
83
|
+
months.push(`${temp}月`)
|
|
84
|
+
}
|
|
85
|
+
if (fields === 'month') {
|
|
86
|
+
return [years, months]
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
rangeKey: String,
|
|
113
|
-
value: {
|
|
114
|
-
type: [Number, String, Array],
|
|
115
|
-
default () {
|
|
116
|
-
switch (this.mode) {
|
|
117
|
-
case 'selector':
|
|
118
|
-
return 0
|
|
119
|
-
case 'multiSelector':
|
|
120
|
-
return []
|
|
121
|
-
case 'time':
|
|
122
|
-
return ''
|
|
123
|
-
case 'date':
|
|
124
|
-
return ''
|
|
125
|
-
default:
|
|
126
|
-
return ''
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
start: {
|
|
131
|
-
type: String,
|
|
132
|
-
default: '1970-01-01'
|
|
133
|
-
},
|
|
134
|
-
end: {
|
|
135
|
-
type: String,
|
|
136
|
-
default: '2100-01-01'
|
|
137
|
-
},
|
|
138
|
-
fields: {
|
|
139
|
-
type: String,
|
|
140
|
-
default: 'day'
|
|
141
|
-
},
|
|
142
|
-
scrollOptions: {
|
|
143
|
-
type: Object,
|
|
144
|
-
default: () => {
|
|
145
|
-
return {}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
89
|
+
for (let i = 1; i <= 31; i++) {
|
|
90
|
+
let temp = i < 10 ? `0${i}` : i
|
|
91
|
+
days.push(`${temp}日`)
|
|
92
|
+
}
|
|
93
|
+
return [years, months, days]
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default {
|
|
97
|
+
name: 'mpx-picker',
|
|
98
|
+
props: {
|
|
99
|
+
mode: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: 'selector'
|
|
148
102
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
itemHeight: 0
|
|
103
|
+
disabled: Boolean,
|
|
104
|
+
range: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default () {
|
|
107
|
+
return []
|
|
155
108
|
}
|
|
156
109
|
},
|
|
157
|
-
|
|
158
|
-
|
|
110
|
+
rangeKey: String,
|
|
111
|
+
value: {
|
|
112
|
+
type: [Number, String, Array],
|
|
113
|
+
default () {
|
|
159
114
|
switch (this.mode) {
|
|
160
115
|
case 'selector':
|
|
161
|
-
return
|
|
116
|
+
return 0
|
|
162
117
|
case 'multiSelector':
|
|
163
|
-
return
|
|
164
|
-
return getPickerData(item, this.rangeKey)
|
|
165
|
-
})
|
|
118
|
+
return []
|
|
166
119
|
case 'time':
|
|
167
|
-
return
|
|
120
|
+
return ''
|
|
168
121
|
case 'date':
|
|
169
|
-
return
|
|
122
|
+
return ''
|
|
170
123
|
default:
|
|
171
|
-
return
|
|
124
|
+
return ''
|
|
172
125
|
}
|
|
173
126
|
}
|
|
174
127
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
value: {
|
|
180
|
-
handler () {
|
|
181
|
-
let valueTemp = []
|
|
182
|
-
switch (this.mode) {
|
|
183
|
-
case 'selector':
|
|
184
|
-
this.selectedIndex = [this.value]
|
|
185
|
-
break
|
|
186
|
-
case 'multiSelector':
|
|
187
|
-
this.selectedIndex = []
|
|
188
|
-
for (let i = 0; i < this.range.length; i++) {
|
|
189
|
-
this.selectedIndex[i] = this.value[i] || 0
|
|
190
|
-
}
|
|
191
|
-
break
|
|
192
|
-
case 'time':
|
|
193
|
-
this.selectedIndex = []
|
|
194
|
-
if (!this.value) {
|
|
195
|
-
valueTemp = [new Date().getHours(), new Date().getMinutes()]
|
|
196
|
-
} else {
|
|
197
|
-
valueTemp = this.value && this.value.split(':')
|
|
198
|
-
}
|
|
199
|
-
for (let i = 0; i < valueTemp.length; i++) {
|
|
200
|
-
this.selectedIndex[i] = valueTemp[i] || 0
|
|
201
|
-
}
|
|
202
|
-
break
|
|
203
|
-
case 'date':
|
|
204
|
-
this.selectedIndex = []
|
|
205
|
-
if (!this.value) {
|
|
206
|
-
valueTemp = [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()]
|
|
207
|
-
} else {
|
|
208
|
-
valueTemp = this.value && this.value.split('-')
|
|
209
|
-
}
|
|
210
|
-
let result = Object.keys(this.pickerData[0]).filter(item => startYear + Number(item) === Number(valueTemp[0]))
|
|
211
|
-
this.selectedIndex[0] = Number(result[0])
|
|
212
|
-
for (let i = 1; i < valueTemp.length; i++) {
|
|
213
|
-
this.selectedIndex[i] = valueTemp[i] - 1
|
|
214
|
-
}
|
|
215
|
-
break
|
|
216
|
-
default:
|
|
217
|
-
this.selectedIndex = [0]
|
|
218
|
-
}
|
|
219
|
-
this.refresh()
|
|
220
|
-
},
|
|
221
|
-
immediate: true
|
|
222
|
-
}
|
|
128
|
+
start: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: '1970-01-01'
|
|
223
131
|
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.initRangeIndex()
|
|
132
|
+
end: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: '2100-01-01'
|
|
228
135
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
})
|
|
233
|
-
this.wheels = []
|
|
136
|
+
fields: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: 'day'
|
|
234
139
|
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
140
|
+
scrollOptions: {
|
|
141
|
+
type: Object,
|
|
142
|
+
default: () => {
|
|
143
|
+
return {}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
data () {
|
|
148
|
+
return {
|
|
149
|
+
isShow: false,
|
|
150
|
+
startIndex: [0, 0, 0],
|
|
151
|
+
endIndex: [0, 0, 0],
|
|
152
|
+
itemHeight: 0
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
computed: {
|
|
156
|
+
pickerData () {
|
|
157
|
+
switch (this.mode) {
|
|
158
|
+
case 'selector':
|
|
159
|
+
return [getPickerData(this.range, this.rangeKey)]
|
|
160
|
+
case 'multiSelector':
|
|
161
|
+
return this.range.map((item) => {
|
|
162
|
+
return getPickerData(item, this.rangeKey)
|
|
163
|
+
})
|
|
164
|
+
case 'time':
|
|
165
|
+
return getTimePickerData()
|
|
166
|
+
case 'date':
|
|
167
|
+
return getDatePickerData(this.fields)
|
|
168
|
+
default:
|
|
169
|
+
return []
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
watch: {
|
|
174
|
+
pickerData () {
|
|
175
|
+
this.refresh()
|
|
176
|
+
},
|
|
177
|
+
value: {
|
|
178
|
+
handler () {
|
|
242
179
|
let valueTemp = []
|
|
243
180
|
switch (this.mode) {
|
|
244
181
|
case 'selector':
|
|
245
|
-
|
|
182
|
+
this.selectedIndex = [this.value]
|
|
246
183
|
break
|
|
247
184
|
case 'multiSelector':
|
|
248
|
-
|
|
185
|
+
this.selectedIndex = []
|
|
186
|
+
for (let i = 0; i < this.range.length; i++) {
|
|
187
|
+
this.selectedIndex[i] = this.value[i] || 0
|
|
188
|
+
}
|
|
249
189
|
break
|
|
250
190
|
case 'time':
|
|
251
|
-
|
|
252
|
-
|
|
191
|
+
this.selectedIndex = []
|
|
192
|
+
if (!this.value) {
|
|
193
|
+
valueTemp = [new Date().getHours(), new Date().getMinutes()]
|
|
194
|
+
} else {
|
|
195
|
+
valueTemp = this.value && this.value.split(':')
|
|
196
|
+
}
|
|
197
|
+
for (let i = 0; i < valueTemp.length; i++) {
|
|
198
|
+
this.selectedIndex[i] = valueTemp[i] || 0
|
|
253
199
|
}
|
|
254
|
-
value = `${valueTemp[0]}:${valueTemp[1]}`
|
|
255
200
|
break
|
|
256
201
|
case 'date':
|
|
257
|
-
|
|
258
|
-
if (this.
|
|
259
|
-
|
|
260
|
-
|
|
202
|
+
this.selectedIndex = []
|
|
203
|
+
if (!this.value) {
|
|
204
|
+
valueTemp = [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()]
|
|
205
|
+
} else {
|
|
206
|
+
valueTemp = this.value && this.value.split('-')
|
|
261
207
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
break
|
|
208
|
+
let result = Object.keys(this.pickerData[0]).filter(item => startYear + Number(item) === Number(valueTemp[0]))
|
|
209
|
+
this.selectedIndex[0] = Number(result[0])
|
|
210
|
+
for (let i = 1; i < valueTemp.length; i++) {
|
|
211
|
+
this.selectedIndex[i] = valueTemp[i] - 1
|
|
267
212
|
}
|
|
268
|
-
|
|
269
|
-
let day = this.selectedIndex[2] < 9 ? `0${this.selectedIndex[2] + 1}` : this.selectedIndex[2] + 1
|
|
270
|
-
value = `${year}-${month}-${day}`
|
|
271
213
|
break
|
|
272
214
|
default:
|
|
273
|
-
|
|
215
|
+
this.selectedIndex = [0]
|
|
274
216
|
}
|
|
275
|
-
this
|
|
276
|
-
},
|
|
277
|
-
_cancel () {
|
|
278
|
-
this.hide()
|
|
279
|
-
this.$emit('cancel', getCustomEvent('cancel', {}, this))
|
|
280
|
-
},
|
|
281
|
-
_isMoving () {
|
|
282
|
-
return this.wheels.some((wheel) => {
|
|
283
|
-
return wheel.pending
|
|
284
|
-
})
|
|
285
|
-
},
|
|
286
|
-
show () {
|
|
287
|
-
this.isShow = true
|
|
288
|
-
if (this.needRefresh) {
|
|
289
|
-
this.needRefresh = false
|
|
290
|
-
this.refresh()
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
hide () {
|
|
294
|
-
this.isShow = false
|
|
217
|
+
this.refresh()
|
|
295
218
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
219
|
+
immediate: true
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
mounted () {
|
|
223
|
+
this.wheels = []
|
|
224
|
+
this.refresh()
|
|
225
|
+
this.initRangeIndex()
|
|
226
|
+
},
|
|
227
|
+
beforeDestroy () {
|
|
228
|
+
this.wheels.forEach((wheel) => {
|
|
229
|
+
wheel.destroy()
|
|
230
|
+
})
|
|
231
|
+
this.wheels = []
|
|
232
|
+
},
|
|
233
|
+
methods: {
|
|
234
|
+
_confirm () {
|
|
235
|
+
if (this._isMoving()) {
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
this.hide()
|
|
239
|
+
let value = ''
|
|
240
|
+
let valueTemp = []
|
|
241
|
+
switch (this.mode) {
|
|
242
|
+
case 'selector':
|
|
243
|
+
value = this.selectedIndex[0]
|
|
244
|
+
break
|
|
245
|
+
case 'multiSelector':
|
|
246
|
+
value = this.selectedIndex.slice()
|
|
247
|
+
break
|
|
248
|
+
case 'time':
|
|
249
|
+
for (let i = 0; i < this.selectedIndex.length; i++) {
|
|
250
|
+
valueTemp[i] = this.selectedIndex[i] < 10 ? `0${Number(this.selectedIndex[i])}` : `${this.selectedIndex[i]}`
|
|
251
|
+
}
|
|
252
|
+
value = `${valueTemp[0]}:${valueTemp[1]}`
|
|
253
|
+
break
|
|
254
|
+
case 'date':
|
|
255
|
+
let year = this.pickerData[0][this.selectedIndex[0]].replace('年', '')
|
|
256
|
+
if (this.fields === 'year') {
|
|
257
|
+
value = `${year}`
|
|
258
|
+
break
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let month = this.selectedIndex[1] < 9 ? `0${this.selectedIndex[1] + 1}` : this.selectedIndex[1] + 1
|
|
262
|
+
if (this.fields === 'month') {
|
|
263
|
+
value = `${year}-${month}`
|
|
264
|
+
break
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
let day = this.selectedIndex[2] < 9 ? `0${this.selectedIndex[2] + 1}` : this.selectedIndex[2] + 1
|
|
268
|
+
value = `${year}-${month}-${day}`
|
|
269
|
+
break
|
|
270
|
+
default:
|
|
271
|
+
value = this.selectedIndex[0]
|
|
272
|
+
}
|
|
273
|
+
this.$emit('change', getCustomEvent('change', { value }, this))
|
|
274
|
+
},
|
|
275
|
+
_cancel () {
|
|
276
|
+
this.hide()
|
|
277
|
+
this.$emit('cancel', getCustomEvent('cancel', {}, this))
|
|
278
|
+
},
|
|
279
|
+
_isMoving () {
|
|
280
|
+
return this.wheels.some((wheel) => {
|
|
281
|
+
return wheel.pending
|
|
282
|
+
})
|
|
283
|
+
},
|
|
284
|
+
show () {
|
|
285
|
+
this.isShow = true
|
|
286
|
+
if (this.needRefresh) {
|
|
287
|
+
this.needRefresh = false
|
|
288
|
+
this.refresh()
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
hide () {
|
|
292
|
+
this.isShow = false
|
|
293
|
+
},
|
|
294
|
+
refresh () {
|
|
295
|
+
if (this.isShow) {
|
|
296
|
+
if (this.refreshing) return
|
|
297
|
+
this.refreshing = true
|
|
298
|
+
this.$nextTick(() => {
|
|
299
|
+
let i = 0
|
|
300
|
+
const wheelWrapper = this.$refs.wheelWrapper
|
|
301
|
+
for (; i < this.pickerData.length; i++) {
|
|
302
|
+
this.selectedIndex[i] = +this.selectedIndex[i] || 0
|
|
303
|
+
if (this.selectedIndex[i] >= this.pickerData[i].length) {
|
|
304
|
+
this.selectedIndex[i] = 0
|
|
305
|
+
}
|
|
306
|
+
if (this.wheels[i]) {
|
|
307
|
+
this.wheels[i].refresh()
|
|
308
|
+
if (this.wheels[i].getSelectedIndex() !== this.selectedIndex[i]) {
|
|
309
|
+
this.wheels[i].wheelTo(this.selectedIndex[i])
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
this.wheels[i] = new BScroll(wheelWrapper.children[i], extend({
|
|
313
|
+
wheel: {
|
|
314
|
+
selectedIndex: this.selectedIndex[i],
|
|
315
|
+
wheelWrapperClass: 'wheel-scroll',
|
|
316
|
+
wheelItemClass: 'wheel-item'
|
|
317
|
+
},
|
|
318
|
+
probeType: 3,
|
|
319
|
+
bindToWrapper: true
|
|
320
|
+
}, this.scrollOptions))
|
|
321
|
+
if (this.mode === 'time' || this.mode === 'date') {
|
|
322
|
+
this.wheels[i].on('scrollStart', function (i) {
|
|
323
|
+
this.handleScrollStart()
|
|
324
|
+
}.bind(this, i))
|
|
307
325
|
}
|
|
308
|
-
|
|
309
|
-
this.
|
|
310
|
-
|
|
311
|
-
|
|
326
|
+
this.wheels[i].on('scrollEnd', function (i) {
|
|
327
|
+
if (this.refreshing) return
|
|
328
|
+
const currentIndex = this.wheels[i].getSelectedIndex()
|
|
329
|
+
if (this.selectedIndex[i] !== currentIndex) {
|
|
330
|
+
this.selectedIndex[i] = currentIndex
|
|
331
|
+
if (this.mode === 'multiSelector') {
|
|
332
|
+
this.$emit('columnchange', getCustomEvent('columnchange', {
|
|
333
|
+
column: i,
|
|
334
|
+
value: currentIndex
|
|
335
|
+
}, this))
|
|
336
|
+
}
|
|
312
337
|
}
|
|
313
|
-
} else {
|
|
314
|
-
this.wheels[i] = new BScroll(wheelWrapper.children[i], {
|
|
315
|
-
wheel: {
|
|
316
|
-
selectedIndex: this.selectedIndex[i],
|
|
317
|
-
wheelWrapperClass: 'wheel-scroll',
|
|
318
|
-
wheelItemClass: 'wheel-item'
|
|
319
|
-
},
|
|
320
|
-
probeType: 3,
|
|
321
|
-
bindToWrapper: true,
|
|
322
|
-
...this.scrollOptions
|
|
323
|
-
})
|
|
324
338
|
if (this.mode === 'time' || this.mode === 'date') {
|
|
325
|
-
this.
|
|
326
|
-
this.handleScrollStart()
|
|
327
|
-
}.bind(this, i))
|
|
339
|
+
this.handleScrollEnd()
|
|
328
340
|
}
|
|
329
|
-
|
|
330
|
-
if (this.refreshing) return
|
|
331
|
-
const currentIndex = this.wheels[i].getSelectedIndex()
|
|
332
|
-
if (this.selectedIndex[i] !== currentIndex) {
|
|
333
|
-
this.selectedIndex[i] = currentIndex
|
|
334
|
-
if (this.mode === 'multiSelector') {
|
|
335
|
-
this.$emit('columnchange', getCustomEvent('columnchange', {
|
|
336
|
-
column: i,
|
|
337
|
-
value: currentIndex
|
|
338
|
-
}, this))
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
if (this.mode === 'time' || this.mode === 'date') {
|
|
342
|
-
this.handleScrollEnd()
|
|
343
|
-
}
|
|
344
|
-
}.bind(this, i))
|
|
345
|
-
}
|
|
341
|
+
}.bind(this, i))
|
|
346
342
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
343
|
+
}
|
|
344
|
+
if (this.mode === 'time' || this.mode === 'date') {
|
|
345
|
+
this.initWheelPosition()
|
|
346
|
+
}
|
|
347
|
+
for (; i < this.wheels.length; i++) {
|
|
348
|
+
if (this.wheels[i]) {
|
|
349
|
+
this.wheels[i].destroy()
|
|
354
350
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
351
|
+
}
|
|
352
|
+
this.wheels.length = this.pickerData.length
|
|
353
|
+
this.selectedIndex.length = this.pickerData.length
|
|
354
|
+
this.refreshing = false
|
|
355
|
+
})
|
|
356
|
+
} else {
|
|
357
|
+
this.needRefresh = true
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
initRangeIndex () {
|
|
361
|
+
if (this.mode !== 'time' && this.mode !== 'date') {
|
|
362
|
+
return
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
this.itemHeight = window.getComputedStyle(document.getElementsByClassName('wheel-item')[0]).height.replace(/px/g, '')
|
|
366
|
+
if (this.mode === 'time') {
|
|
367
|
+
this.startIndex = [this.getIndex('start', 0, ':'), this.getIndex('start', 1, ':')]
|
|
368
|
+
this.endIndex = [this.getIndex('end', 0, ':'), this.getIndex('end', 1, ':')]
|
|
369
|
+
}
|
|
370
|
+
if (this.mode === 'date') {
|
|
371
|
+
this.startIndex = [this.getIndex('start', 0, '-') - startYear, this.getIndex('start', 1, '-') - 1, this.getIndex('start', 2, '-') - 1]
|
|
372
|
+
this.endIndex = [this.getIndex('end', 0, '-') - startYear, this.getIndex('end', 1, '-') - 1, this.getIndex('end', 2, '-') - 1]
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
getIndex (type, i, delimiter) {
|
|
376
|
+
return this[type] && Number(this[type].split(delimiter)[i])
|
|
377
|
+
},
|
|
378
|
+
handleScrollStart () {
|
|
379
|
+
// 重置可滚动距离
|
|
380
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
381
|
+
this.wheels[i].minScrollY = 0
|
|
382
|
+
this.wheels[i].maxScrollY = -(modeOptions[this.mode][i] * this.itemHeight)
|
|
383
|
+
}
|
|
384
|
+
//开始滚动 判断最多可滚动距离
|
|
385
|
+
if (this.start) {
|
|
386
|
+
this.wheels[0].minScrollY = -(this.startIndex[0] * this.itemHeight)
|
|
367
387
|
|
|
368
|
-
this.itemHeight = window.getComputedStyle(document.getElementsByClassName('wheel-item')[0]).height.replace(/px/g, '')
|
|
369
|
-
if (this.mode === 'time') {
|
|
370
|
-
this.startIndex = [this.getIndex('start', 0, ':'), this.getIndex('start', 1, ':')]
|
|
371
|
-
this.endIndex = [this.getIndex('end', 0, ':'), this.getIndex('end', 1, ':')]
|
|
372
|
-
}
|
|
373
|
-
if (this.mode === 'date') {
|
|
374
|
-
this.startIndex = [this.getIndex('start', 0, '-') - startYear, this.getIndex('start', 1, '-') - 1, this.getIndex('start', 2, '-') - 1]
|
|
375
|
-
this.endIndex = [this.getIndex('end', 0, '-') - startYear, this.getIndex('end', 1, '-') - 1, this.getIndex('end', 2, '-') - 1]
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
getIndex (type, i, delimiter) {
|
|
379
|
-
return this[type] && Number(this[type].split(delimiter)[i])
|
|
380
|
-
},
|
|
381
|
-
handleScrollStart () {
|
|
382
|
-
// 重置可滚动距离
|
|
383
388
|
for (let i = 0; i < this.wheels.length; i++) {
|
|
384
|
-
this.wheels[i].
|
|
385
|
-
|
|
389
|
+
if (!(this.wheels[i + 1] && this.wheels[i].getSelectedIndex() === this.startIndex[i])) {
|
|
390
|
+
break
|
|
391
|
+
}
|
|
392
|
+
this.wheels[i + 1].minScrollY = -(this.startIndex[i + 1] * this.itemHeight)
|
|
393
|
+
this.wheels[i + 1].maxScrollY = -(modeOptions[this.mode][i + 1] * this.itemHeight)
|
|
386
394
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
395
|
+
}
|
|
396
|
+
if (this.end) {
|
|
397
|
+
this.wheels[0].maxScrollY = -(this.endIndex[0] * this.itemHeight)
|
|
390
398
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
399
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
400
|
+
if (!(this.wheels[i + 1] && this.wheels[i].getSelectedIndex() === this.endIndex[i])) {
|
|
401
|
+
break
|
|
402
|
+
}
|
|
403
|
+
this.wheels[i + 1].minScrollY = 0
|
|
404
|
+
this.wheels[i + 1].maxScrollY = -(this.endIndex[i + 1] * this.itemHeight)
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
handleScrollEnd () {
|
|
409
|
+
const solarMonths = [1, 3, 5, 7, 8, 10, 12]
|
|
410
|
+
if (this.start) {
|
|
411
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
412
|
+
if (!(this.wheels[i].getSelectedIndex() === this.startIndex[i]) || !(this.wheels[i + 1])) {
|
|
413
|
+
break
|
|
414
|
+
}
|
|
415
|
+
if (this.wheels[i + 1].getSelectedIndex() < this.startIndex[i + 1]) {
|
|
416
|
+
this.wheels[i + 1].minScrollY = 0
|
|
396
417
|
this.wheels[i + 1].maxScrollY = -(modeOptions[this.mode][i + 1] * this.itemHeight)
|
|
418
|
+
this.wheels[i + 1].wheelTo([this.startIndex[i + 1]])
|
|
397
419
|
}
|
|
398
420
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
421
|
+
}
|
|
422
|
+
if (this.end) {
|
|
423
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
424
|
+
if (!(this.wheels[i].getSelectedIndex() === this.endIndex[i]) || !(this.wheels[i + 1])) {
|
|
425
|
+
break
|
|
426
|
+
}
|
|
427
|
+
if (this.wheels[i + 1].getSelectedIndex() > this.endIndex[i + 1]) {
|
|
406
428
|
this.wheels[i + 1].minScrollY = 0
|
|
407
|
-
this.wheels[i + 1].maxScrollY = -(this.
|
|
429
|
+
this.wheels[i + 1].maxScrollY = -(modeOptions[this.mode][i + 1] * this.itemHeight)
|
|
430
|
+
this.wheels[i + 1].wheelTo([this.endIndex[i + 1]])
|
|
408
431
|
}
|
|
409
432
|
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
433
|
+
}
|
|
434
|
+
// 单独处理小月30天,2月28天或29天情况
|
|
435
|
+
if (this.mode === 'date' && this.fields === 'day' && !solarMonths.includes(this.wheels[1].getSelectedIndex() + 1)) {
|
|
436
|
+
const currentYear = this.wheels[0].getSelectedIndex() + startYear
|
|
437
|
+
const isFebruary = this.wheels[1].getSelectedIndex() === 1
|
|
438
|
+
const isLeapYear = (currentYear % 4 === 0 && (currentYear % 100 !== 0)) || (currentYear % 400 === 0)
|
|
439
|
+
const day = isFebruary && (isLeapYear ? 28 : 27) || 29
|
|
440
|
+
this.wheels[2].getSelectedIndex() > day && this.wheels[2].wheelTo([0])
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
},
|
|
444
|
+
initWheelPosition () {
|
|
445
|
+
if (this.start) {
|
|
446
|
+
if (this.wheels[0].getSelectedIndex() < this.startIndex[0]) {
|
|
414
447
|
for (let i = 0; i < this.wheels.length; i++) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
if (this.wheels[i + 1].getSelectedIndex() < this.startIndex[i + 1]) {
|
|
419
|
-
this.wheels[i + 1].minScrollY = 0
|
|
420
|
-
this.wheels[i + 1].maxScrollY = -(modeOptions[this.mode][i+1] * this.itemHeight)
|
|
421
|
-
this.wheels[i + 1].wheelTo([this.startIndex[i + 1]])
|
|
422
|
-
}
|
|
448
|
+
this.wheels[i].wheelTo([this.startIndex[i]])
|
|
449
|
+
this.selectedIndex[i] = this.startIndex[i] || 0
|
|
423
450
|
}
|
|
424
|
-
}
|
|
425
|
-
if (this.end) {
|
|
451
|
+
} else {
|
|
426
452
|
for (let i = 0; i < this.wheels.length; i++) {
|
|
427
|
-
if (
|
|
453
|
+
if (this.wheels[i].getSelectedIndex() !== this.startIndex[i]) {
|
|
428
454
|
break
|
|
429
455
|
}
|
|
430
|
-
if (this.wheels[i + 1].getSelectedIndex()
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
// 单独处理小月30天,2月28天或29天情况
|
|
438
|
-
if (this.mode === 'date' && this.fields === 'day' && !solarMonths.includes(this.wheels[1].getSelectedIndex() + 1)) {
|
|
439
|
-
const currentYear = this.wheels[0].getSelectedIndex() + startYear
|
|
440
|
-
const isFebruary = this.wheels[1].getSelectedIndex() === 1
|
|
441
|
-
const isLeapYear = (currentYear % 4 === 0 && (currentYear % 100 !== 0)) || (currentYear % 400 === 0)
|
|
442
|
-
const day = isFebruary && (isLeapYear ? 28 : 27) || 29
|
|
443
|
-
this.wheels[2].getSelectedIndex() > day && this.wheels[2].wheelTo([0])
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
},
|
|
447
|
-
initWheelPosition () {
|
|
448
|
-
if (this.start) {
|
|
449
|
-
if (this.wheels[0].getSelectedIndex() < this.startIndex[0]) {
|
|
450
|
-
for (let i = 0; i < this.wheels.length; i++) {
|
|
451
|
-
this.wheels[i].wheelTo([this.startIndex[i]])
|
|
452
|
-
this.selectedIndex[i] = this.startIndex[i] || 0
|
|
453
|
-
}
|
|
454
|
-
} else {
|
|
455
|
-
for (let i = 0; i < this.wheels.length; i++) {
|
|
456
|
-
if (this.wheels[i].getSelectedIndex() !== this.startIndex[i]) {
|
|
457
|
-
break
|
|
458
|
-
}
|
|
459
|
-
if (this.wheels[i+1] && this.wheels[i+1].getSelectedIndex() < this.startIndex[i+1]) {
|
|
460
|
-
for (let j = i+1; j < this.wheels.length; j++) {
|
|
461
|
-
this.wheels[j].wheelTo([this.startIndex[j]])
|
|
462
|
-
this.selectedIndex[j] = this.startIndex[j] || 0
|
|
463
|
-
}
|
|
456
|
+
if (this.wheels[i + 1] && this.wheels[i + 1].getSelectedIndex() < this.startIndex[i + 1]) {
|
|
457
|
+
for (let j = i + 1; j < this.wheels.length; j++) {
|
|
458
|
+
this.wheels[j].wheelTo([this.startIndex[j]])
|
|
459
|
+
this.selectedIndex[j] = this.startIndex[j] || 0
|
|
464
460
|
}
|
|
465
461
|
}
|
|
466
462
|
}
|
|
467
463
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
464
|
+
}
|
|
465
|
+
if (this.end) {
|
|
466
|
+
if (this.wheels[0].getSelectedIndex() > this.endIndex[0]) {
|
|
467
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
468
|
+
this.wheels[i].wheelTo([this.endIndex[i]])
|
|
469
|
+
this.selectedIndex[i] = this.endIndex[i] || 0
|
|
470
|
+
}
|
|
471
|
+
} else {
|
|
472
|
+
for (let i = 0; i < this.wheels.length; i++) {
|
|
473
|
+
if (this.wheels[i].getSelectedIndex() !== this.endIndex[i]) {
|
|
474
|
+
break
|
|
473
475
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
if (this.wheels[i+1] && this.wheels[i+1].getSelectedIndex() > this.endIndex[i+1]) {
|
|
480
|
-
for (let j = i+1; j < this.wheels.length; j++) {
|
|
481
|
-
this.wheels[j].wheelTo([this.endIndex[j]])
|
|
482
|
-
this.selectedIndex[j] = this.endIndex[j] || 0
|
|
483
|
-
}
|
|
476
|
+
if (this.wheels[i + 1] && this.wheels[i + 1].getSelectedIndex() > this.endIndex[i + 1]) {
|
|
477
|
+
for (let j = i + 1; j < this.wheels.length; j++) {
|
|
478
|
+
this.wheels[j].wheelTo([this.endIndex[j]])
|
|
479
|
+
this.selectedIndex[j] = this.endIndex[j] || 0
|
|
484
480
|
}
|
|
485
481
|
}
|
|
486
482
|
}
|
|
@@ -488,6 +484,7 @@
|
|
|
488
484
|
}
|
|
489
485
|
}
|
|
490
486
|
}
|
|
487
|
+
}
|
|
491
488
|
</script>
|
|
492
489
|
|
|
493
490
|
<style scoped lang="stylus" rel="stylesheet/stylus">
|