md-iview 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/package.json +116 -0
- package/src/components/libs/util.js +117 -0
- package/src/components/md-error-page/403.less +92 -0
- package/src/components/md-error-page/403.vue +34 -0
- package/src/components/md-error-page/404.less +60 -0
- package/src/components/md-error-page/404.vue +34 -0
- package/src/components/md-error-page/500.less +73 -0
- package/src/components/md-error-page/500.vue +36 -0
- package/src/components/md-error-page/demo/index.less +22 -0
- package/src/components/md-error-page/demo/index.vue +97 -0
- package/src/components/md-form-item/index.js +3 -0
- package/src/components/md-icon/icon.vue +77 -0
- package/src/components/md-icon/icons.js +5 -0
- package/src/components/md-icon/index.js +11 -0
- package/src/components/md-icon/style/index.less +1 -0
- package/src/components/md-loading/index.js +55 -0
- package/src/components/md-loading/index.vue +53 -0
- package/src/components/md-loading/md-loading.js +38 -0
- package/src/components/md-print/demo/index.vue +260 -0
- package/src/components/md-print/index.js +123 -0
- package/src/components/md-rich-editor/index.vue +69 -0
- package/src/components/md-rich-editor/module/image-extend/index.js +216 -0
- package/src/components/md-scroll-bar/demo/index.vue +102 -0
- package/src/components/md-scroll-bar/index.js +3 -0
- package/src/components/md-scroll-bar/index.less +90 -0
- package/src/components/md-scroll-bar/index.vue +250 -0
- package/src/components/md-select/index.js +7 -0
- package/src/components/md-select/select.vue +841 -0
- package/src/components/md-shrinkable-menu/components/sidebarMenu.vue +167 -0
- package/src/components/md-shrinkable-menu/components/sidebarMenuShrink.vue +119 -0
- package/src/components/md-shrinkable-menu/demo/data/cachePage.js +1 -0
- package/src/components/md-shrinkable-menu/demo/data/currentPath.js +9 -0
- package/src/components/md-shrinkable-menu/demo/data/menu.js +575 -0
- package/src/components/md-shrinkable-menu/demo/data/menu2.js +1017 -0
- package/src/components/md-shrinkable-menu/demo/data/pageTagsList.js +153 -0
- package/src/components/md-shrinkable-menu/demo/index.less +297 -0
- package/src/components/md-shrinkable-menu/demo/index.vue +285 -0
- package/src/components/md-shrinkable-menu/index.vue +112 -0
- package/src/components/md-shrinkable-menu/sidebar.vue +195 -0
- package/src/components/md-shrinkable-menu/styles/menu.less +5 -0
- package/src/components/md-shrinkable-menu/styles/sidebar.less +363 -0
- package/src/components/md-split-pane/demo/index.vue +101 -0
- package/src/components/md-split-pane/index.js +3 -0
- package/src/components/md-split-pane/index.less +93 -0
- package/src/components/md-split-pane/index.vue +230 -0
- package/src/components/md-table/action-tooltip.vue +45 -0
- package/src/components/md-table/can-edit-v2.vue +823 -0
- package/src/components/md-table/can-edit.vue +723 -0
- package/src/components/md-table/custom-cell.vue +71 -0
- package/src/components/md-table/date-picker-cell-v2.vue +48 -0
- package/src/components/md-table/date-picker-cell.vue +39 -0
- package/src/components/md-table/demo/data/search.js +67 -0
- package/src/components/md-table/demo/data/table2csv.js +200 -0
- package/src/components/md-table/demo/data/table2excel.js +239 -0
- package/src/components/md-table/demo/data/table_data.js +251 -0
- package/src/components/md-table/demo/editable-table.vue +144 -0
- package/src/components/md-table/demo/exportable-table.vue +124 -0
- package/src/components/md-table/demo/widgets/header-search.vue +88 -0
- package/src/components/md-table/drop-down-cell-v2.vue +87 -0
- package/src/components/md-table/drop-down-cell.vue +81 -0
- package/src/components/md-table/editable-expand.vue +143 -0
- package/src/components/md-table/expand.vue +97 -0
- package/src/components/md-table/index.vue +53 -0
- package/src/components/md-table/iview-table/cell.vue +99 -0
- package/src/components/md-table/iview-table/expand.js +21 -0
- package/src/components/md-table/iview-table/export-csv.js +76 -0
- package/src/components/md-table/iview-table/header.js +16 -0
- package/src/components/md-table/iview-table/index.js +2 -0
- package/src/components/md-table/iview-table/mixin.js +31 -0
- package/src/components/md-table/iview-table/table-body.vue +101 -0
- package/src/components/md-table/iview-table/table-head.vue +311 -0
- package/src/components/md-table/iview-table/table-tr.vue +31 -0
- package/src/components/md-table/iview-table/table.vue +1026 -0
- package/src/components/md-table/iview-table/util.js +93 -0
- package/src/components/md-table/libs/table2excel.js +100 -0
- package/src/components/md-table/select-cell-v2.vue +64 -0
- package/src/components/md-table/select-cell.vue +46 -0
- package/src/components/md-table/table.less +76 -0
- package/src/components/md-toolbar/index.vue +171 -0
- package/src/components/md-tree/index.js +2 -0
- package/src/components/md-tree/node.vue +238 -0
- package/src/components/md-tree/render.js +17 -0
- package/src/components/md-tree/tree.vue +241 -0
- package/src/components/utilities/can.js +35 -0
- package/src/directives/index.js +34 -0
- package/src/directives/resize.js +27 -0
- package/src/directives/scroll.js +27 -0
- package/src/directives/style/bg-color.js +23 -0
- package/src/directives/style/color.js +23 -0
- package/src/directives/style/font-size.js +23 -0
- package/src/directives/style/height.js +23 -0
- package/src/directives/style/lineHeight.js +23 -0
- package/src/directives/style/margin.js +48 -0
- package/src/directives/style/opacity.js +23 -0
- package/src/directives/style/padding.js +48 -0
- package/src/directives/style/width.js +24 -0
- package/src/index.js +442 -0
- package/src/locale/lang.js +5 -0
- package/src/mixins/colorable.js +51 -0
- package/src/style/color/bezierEasing.less +110 -0
- package/src/style/color/colorPalette.less +75 -0
- package/src/style/color/colors.less +146 -0
- package/src/style/color/tinyColor.less +1184 -0
- package/src/style/common.less +72 -0
- package/src/style/components/_ripple.less +60 -0
- package/src/style/components/_shrinkable-menu.less +46 -0
- package/src/style/components/_toolbar.less +96 -0
- package/src/style/components/index.less +3 -0
- package/src/style/components/rich-editor.less +6 -0
- package/src/style/index.less +10 -0
- package/src/style/theme.less +155 -0
- package/src/utils/color.js +46 -0
- package/src/utils/console.js +105 -0
- package/src/utils/load.js +79 -0
- package/src/utils/mask.js +139 -0
- package/src/utils/mixins.js +5 -0
- package/src/utils/validate.js +271 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
<template>
|
2
|
+
<quill-editor ref="textEditor"
|
3
|
+
v-bind="$attrs"
|
4
|
+
v-on="$listeners"
|
5
|
+
:options="editorOption"></quill-editor>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import hljs from 'highlight.js'
|
10
|
+
// import 'quill/dist/quill.core.css'
|
11
|
+
// import 'quill/dist/quill.snow.css'
|
12
|
+
// import 'quill/dist/quill.bubble.css'
|
13
|
+
import { quillEditor, Quill} from 'vue-quill-editor'
|
14
|
+
|
15
|
+
import ImageExtend from './module/image-extend'
|
16
|
+
Quill.register('modules/imageExtend', ImageExtend)
|
17
|
+
export default {
|
18
|
+
name: "md-rich-editor",
|
19
|
+
components: {
|
20
|
+
quillEditor
|
21
|
+
},
|
22
|
+
data() {
|
23
|
+
return {
|
24
|
+
// content: `<h2 class="ql-align-center"><span class="ql-font-serif">Text content loading..</span></h2>`,
|
25
|
+
editorOption: {
|
26
|
+
modules: {
|
27
|
+
toolbar: [
|
28
|
+
['bold', 'italic', 'underline', 'strike'],
|
29
|
+
['blockquote', 'code-block'],
|
30
|
+
[{ 'header': 1 }, { 'header': 2 }],
|
31
|
+
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
32
|
+
[{ 'script': 'sub' }, { 'script': 'super' }],
|
33
|
+
[{ 'indent': '-1' }, { 'indent': '+1' }],
|
34
|
+
[{ 'direction': 'rtl' }],
|
35
|
+
[{ 'size': ['small', false, 'large', 'huge'] }],
|
36
|
+
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
|
37
|
+
[{ 'font': [] }],
|
38
|
+
[{ 'color': [] }, { 'background': [] }],
|
39
|
+
[{ 'align': [] }],
|
40
|
+
['clean'],
|
41
|
+
['link', 'image', 'video'],
|
42
|
+
],
|
43
|
+
syntax: {
|
44
|
+
highlight: text => hljs.highlightAuto(text).value
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
},
|
50
|
+
mounted() {
|
51
|
+
// setTimeout(() => {
|
52
|
+
// this.content = content;
|
53
|
+
// })
|
54
|
+
},
|
55
|
+
|
56
|
+
computed: {
|
57
|
+
editor() {
|
58
|
+
return this.$refs.myTextEditor.quill
|
59
|
+
},
|
60
|
+
contentCode() {
|
61
|
+
return hljs.highlightAuto(this.content).value
|
62
|
+
}
|
63
|
+
},
|
64
|
+
}
|
65
|
+
</script>
|
66
|
+
|
67
|
+
<style lang="less" scoped>
|
68
|
+
@import "../../style/components/rich-editor.less";
|
69
|
+
</style>
|
@@ -0,0 +1,216 @@
|
|
1
|
+
/**
|
2
|
+
* @description 图片功能拓展: 增加上传 拖动 复制
|
3
|
+
*/
|
4
|
+
export default class ImageExtend {
|
5
|
+
/**
|
6
|
+
* @param quill {Quill}富文本实例
|
7
|
+
* @param config {Object} options
|
8
|
+
* config keys: action, headers, editForm start end error size response
|
9
|
+
*/
|
10
|
+
constructor(quill, config = {}) {
|
11
|
+
this.id = Math.random()
|
12
|
+
this.quill = quill
|
13
|
+
this.quill.id = this.id
|
14
|
+
this.config = config
|
15
|
+
this.file = '' // 要上传的图片
|
16
|
+
this.imgURL = '' // 图片地址
|
17
|
+
let quillLoading
|
18
|
+
if (this.config.loading) {
|
19
|
+
quillLoading = document.querySelector('.quillLoading')
|
20
|
+
if (quillLoading === null) {
|
21
|
+
quillLoading = document.createElement('div')
|
22
|
+
quillLoading.classList.add('quill-loading')
|
23
|
+
quillLoading.classList.add('extend-upload-success')
|
24
|
+
document.querySelector('.ql-container').appendChild(quillLoading)
|
25
|
+
}
|
26
|
+
}
|
27
|
+
this.quillLoading = quillLoading
|
28
|
+
quill.root.addEventListener('paste', this.pasteHandle.bind(this), false)
|
29
|
+
quill.root.addEventListener('drop', this.dropHandle.bind(this), false)
|
30
|
+
quill.root.addEventListener('dropover', function (e) {
|
31
|
+
e.preventDefault()
|
32
|
+
}, false)
|
33
|
+
|
34
|
+
QuillWatch.on(this.id, this)
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @description 粘贴
|
39
|
+
* @param e
|
40
|
+
*/
|
41
|
+
pasteHandle(e) {
|
42
|
+
let clipboardData = e.clipboardData
|
43
|
+
let i = 0
|
44
|
+
let items, item, types
|
45
|
+
|
46
|
+
if (clipboardData) {
|
47
|
+
items = clipboardData.items;
|
48
|
+
|
49
|
+
if (!items) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
item = items[0];
|
53
|
+
types = clipboardData.types || [];
|
54
|
+
|
55
|
+
for (; i < types.length; i++) {
|
56
|
+
if (types[i] === 'Files') {
|
57
|
+
item = items[i];
|
58
|
+
break;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
|
62
|
+
this.file = item.getAsFile()
|
63
|
+
let self = this
|
64
|
+
// 如果图片限制大小
|
65
|
+
if (self.config.size && self.file.size >= self.config.size * 1024 * 1024 && self.config.loading) {
|
66
|
+
self.quillLoading.classList.remove('extend-upload-success')
|
67
|
+
self.quillLoading.classList.add('extend-upload-warning-color')
|
68
|
+
self.quillLoading.innerHTML = '图片大小超过限制'
|
69
|
+
setTimeout(function () {
|
70
|
+
self.quillLoading.classList.remove('extend-upload-warning-color')
|
71
|
+
self.quillLoading.classList.add('extend-upload-success')
|
72
|
+
}, 1500)
|
73
|
+
return
|
74
|
+
}
|
75
|
+
if (this.config.action) {
|
76
|
+
this.uploadImg()
|
77
|
+
} else {
|
78
|
+
this.toBase64()
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* 拖拽
|
86
|
+
* @param e
|
87
|
+
*/
|
88
|
+
dropHandle(e) {
|
89
|
+
const self = this
|
90
|
+
e.preventDefault()
|
91
|
+
// 如果图片限制大小
|
92
|
+
if (self.config.size && self.file.size >= self.config.size * 1024 * 1024 && self.config.loading) {
|
93
|
+
self.quillLoading.classList.add('extend-upload-warning-color')
|
94
|
+
self.quillLoading.classList.remove('extend-upload-success')
|
95
|
+
self.quillLoading.innerHTML = '图片大小超过限制'
|
96
|
+
setTimeout(function () {
|
97
|
+
self.quillLoading.classList.remove('extend-upload-warning-color')
|
98
|
+
self.quillLoading.classList.add('extend-upload-success')
|
99
|
+
}, 1500)
|
100
|
+
return
|
101
|
+
}
|
102
|
+
self.file = e.dataTransfer.files[0]; // 获取到第一个上传的文件对象
|
103
|
+
if (this.config.action) {
|
104
|
+
self.uploadImg()
|
105
|
+
} else {
|
106
|
+
self.toBase64()
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* @description 将图片转为base4
|
112
|
+
*/
|
113
|
+
toBase64() {
|
114
|
+
const self = this
|
115
|
+
const reader = new FileReader()
|
116
|
+
reader.onload = (e) => {
|
117
|
+
// 返回base64
|
118
|
+
self.imgURL = e.target.result
|
119
|
+
self.insertImg()
|
120
|
+
}
|
121
|
+
reader.readAsDataURL(self.file)
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* @description 上传图片到服务器
|
126
|
+
*/
|
127
|
+
uploadImg() {
|
128
|
+
const self = this
|
129
|
+
let quillLoading = self.quillLoading
|
130
|
+
let config = self.config
|
131
|
+
// 构造表单
|
132
|
+
let formData = new FormData()
|
133
|
+
formData.append(config.name, self.file)
|
134
|
+
// 自定义修改表单
|
135
|
+
if (config.editForm) {
|
136
|
+
config.editForm(formData)
|
137
|
+
}
|
138
|
+
// 创建ajax请求
|
139
|
+
let xhr = new XMLHttpRequest()
|
140
|
+
xhr.open('post', config.action, true)
|
141
|
+
// 如果有设置请求头
|
142
|
+
if (config.headers) {
|
143
|
+
config.headers(xhr)
|
144
|
+
}
|
145
|
+
if (config.change) {
|
146
|
+
config.change(xhr, formData)
|
147
|
+
}
|
148
|
+
xhr.onload = function (e) {
|
149
|
+
if (self.config.loading) {
|
150
|
+
setTimeout(function () {
|
151
|
+
quillLoading.classList.add('extend-upload-success')
|
152
|
+
}, 1000)
|
153
|
+
}
|
154
|
+
if (xhr.status === 200) {
|
155
|
+
self.quill.root.innerHTML = self.quill.root.innerHTML.replace('[uploading...]', '')
|
156
|
+
let res = JSON.parse(xhr.responseText)
|
157
|
+
self.imgURL = config.response(res)
|
158
|
+
self.insertImg()
|
159
|
+
} else {
|
160
|
+
self.quill.root.innerHTML = self.quill.root.innerHTML.replace('[uploading...]', '[upload error]')
|
161
|
+
}
|
162
|
+
}
|
163
|
+
// 开始上传数据
|
164
|
+
xhr.upload.onloadstart = function (e) {
|
165
|
+
|
166
|
+
let length = (self.quill.getSelection() || {}).index || self.quill.getLength()
|
167
|
+
self.quill.insertText(length, '[uploading...]', { 'color': 'red'}, true)
|
168
|
+
if (self.config.loading) {
|
169
|
+
quillLoading.classList.remove('extend-upload-success')
|
170
|
+
}
|
171
|
+
if (config.start) {
|
172
|
+
config.start()
|
173
|
+
}
|
174
|
+
}
|
175
|
+
// 上传过程
|
176
|
+
xhr.upload.onprogress = function (e) {
|
177
|
+
let complete = (e.loaded / e.total * 100 | 0) + '%'
|
178
|
+
if (self.config.loading) {
|
179
|
+
quillLoading.innerHTML = '已上传' + complete
|
180
|
+
}
|
181
|
+
}
|
182
|
+
// 当发生网络异常的时候会触发,如果上传数据的过程还未结束
|
183
|
+
xhr.upload.onerror = function (e) {
|
184
|
+
self.quill.root.innerHTML = self.quill.root.innerHTML.replace('[uploading...]', '[upload error]')
|
185
|
+
if (self.config.loading) {
|
186
|
+
self.quillLoading.classList.add('extend-upload-warning-color')
|
187
|
+
quillLoading.innerHTML = '网络异常,失败请重试'
|
188
|
+
setTimeout(function () {
|
189
|
+
self.quillLoading.classList.remove('extend-upload-warning-color')
|
190
|
+
quillLoading.classList.add('extend-upload-success')
|
191
|
+
}, 1500)
|
192
|
+
}
|
193
|
+
if (config.error) {
|
194
|
+
config.error()
|
195
|
+
}
|
196
|
+
}
|
197
|
+
// 上传数据完成(成功或者失败)时会触发
|
198
|
+
xhr.upload.onloadend = function (e) {
|
199
|
+
if (config.end) {
|
200
|
+
config.end()
|
201
|
+
}
|
202
|
+
}
|
203
|
+
xhr.send(formData)
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @description 往富文本编辑器插入图片
|
208
|
+
*/
|
209
|
+
insertImg() {
|
210
|
+
const self = this
|
211
|
+
self.quill.blur()
|
212
|
+
let length = (this.quill.getSelection() || {}).index || this.quill.getLength()
|
213
|
+
self.quill.insertEmbed(length, 'image', self.imgURL, 'user')
|
214
|
+
self.quill.setSelection(length + 1)
|
215
|
+
}
|
216
|
+
}
|
@@ -0,0 +1,102 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<Row :gutter="10">
|
4
|
+
<Col span="6">
|
5
|
+
<Card :padding="4">
|
6
|
+
<div class="scroll-container">
|
7
|
+
<scroll-bar
|
8
|
+
scroll-y-type="inner"
|
9
|
+
>
|
10
|
+
<p v-for="i in 100" :key="`item-${i}`">item - {{ i }}</p>
|
11
|
+
</scroll-bar>
|
12
|
+
</div>
|
13
|
+
</Card>
|
14
|
+
</Col>
|
15
|
+
<Col span="6">
|
16
|
+
<Card :padding="4">
|
17
|
+
<div class="scroll-container">
|
18
|
+
<scroll-bar>
|
19
|
+
<p class="list-item" v-for="i in 6" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
20
|
+
</scroll-bar>
|
21
|
+
</div>
|
22
|
+
</Card>
|
23
|
+
</Col>
|
24
|
+
<Col span="6">
|
25
|
+
<Card :padding="4">
|
26
|
+
<div class="scroll-container">
|
27
|
+
<scroll-bar show-all>
|
28
|
+
<p v-for="i in 100" :key="`item-${i}`">item - {{ i }}</p>
|
29
|
+
</scroll-bar>
|
30
|
+
</div>
|
31
|
+
</Card>
|
32
|
+
</Col>
|
33
|
+
<Col span="6">
|
34
|
+
<Card :padding="4">
|
35
|
+
<div class="scroll-container">
|
36
|
+
<scroll-bar show-all>
|
37
|
+
<p class="list-item" v-for="i in 6" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
38
|
+
</scroll-bar>
|
39
|
+
</div>
|
40
|
+
</Card>
|
41
|
+
</Col>
|
42
|
+
</Row>
|
43
|
+
<Row :style="{marginTop: '10px'}" :gutter="10">
|
44
|
+
<Col span="6">
|
45
|
+
<Card :padding="4">
|
46
|
+
<div class="scroll-container">
|
47
|
+
<scroll-bar show-all dis-scroll-x>
|
48
|
+
<p class="list-item" v-for="i in 100" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
49
|
+
</scroll-bar>
|
50
|
+
</div>
|
51
|
+
</Card>
|
52
|
+
</Col>
|
53
|
+
<Col span="6">
|
54
|
+
<Card :padding="4">
|
55
|
+
<div class="scroll-container">
|
56
|
+
<scroll-bar show-all dis-scroll-y>
|
57
|
+
<p class="list-item" v-for="i in 100" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
58
|
+
</scroll-bar>
|
59
|
+
</div>
|
60
|
+
</Card>
|
61
|
+
</Col>
|
62
|
+
<Col span="6">
|
63
|
+
<Card :padding="4">
|
64
|
+
<div class="scroll-container">
|
65
|
+
<scroll-bar show-all scroll-x="none">
|
66
|
+
<p class="list-item" v-for="i in 100" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
67
|
+
</scroll-bar>
|
68
|
+
</div>
|
69
|
+
</Card>
|
70
|
+
</Col>
|
71
|
+
<Col span="6">
|
72
|
+
<Card :padding="4">
|
73
|
+
<div class="scroll-container">
|
74
|
+
<scroll-bar>
|
75
|
+
<p class="list-item" v-for="i in 100" :key="`item-${i}`">item - {{ i }} - item-long-show-x-scrollbar- long-text-make-scroller-x-show-and-useable - item-long-show-x-scrollbar</p>
|
76
|
+
</scroll-bar>
|
77
|
+
</div>
|
78
|
+
</Card>
|
79
|
+
</Col>
|
80
|
+
</Row>
|
81
|
+
</div>
|
82
|
+
</template>
|
83
|
+
|
84
|
+
<script>
|
85
|
+
import scrollBar from '../index';
|
86
|
+
export default {
|
87
|
+
name: 'scroll-bar-page',
|
88
|
+
components: {
|
89
|
+
scrollBar
|
90
|
+
}
|
91
|
+
};
|
92
|
+
</script>
|
93
|
+
|
94
|
+
<style lang="less">
|
95
|
+
.scroll-container{
|
96
|
+
height: 260px;
|
97
|
+
}
|
98
|
+
.list-item{
|
99
|
+
word-break: keep-all;
|
100
|
+
white-space: nowrap;
|
101
|
+
}
|
102
|
+
</style>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
@prefix: ~'vue-scroller-bars';
|
2
|
+
|
3
|
+
.@{prefix}{
|
4
|
+
&-wraper{
|
5
|
+
height: 100%;
|
6
|
+
width: 100%;
|
7
|
+
overflow: hidden;
|
8
|
+
position: relative;
|
9
|
+
&.show-when-hover{
|
10
|
+
.@{prefix}-scroll{
|
11
|
+
opacity: 0;
|
12
|
+
}
|
13
|
+
.@{prefix}-place-holder{
|
14
|
+
opacity: 0;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
&.show-when-hover:hover{
|
18
|
+
.@{prefix}-scroll{
|
19
|
+
opacity: 1;
|
20
|
+
}
|
21
|
+
.@{prefix}-place-holder{
|
22
|
+
opacity: 1;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
&-content{
|
27
|
+
position: absolute;
|
28
|
+
min-width: 100%;
|
29
|
+
left: 0;
|
30
|
+
top: 0;
|
31
|
+
}
|
32
|
+
&-scroll{
|
33
|
+
position: relative;
|
34
|
+
transition: opacity .3s ease .2s;
|
35
|
+
background: rgba(250, 250, 250, 1);
|
36
|
+
box-sizing: border-box;
|
37
|
+
padding: 1px 2px;
|
38
|
+
z-index: 9999999;
|
39
|
+
&:hover &-bar{
|
40
|
+
background: rgb(100, 100, 100);
|
41
|
+
}
|
42
|
+
&-y{
|
43
|
+
width: 14px;
|
44
|
+
height: 100%;
|
45
|
+
float: right;
|
46
|
+
border-left: 1px solid rgba(190, 190, 190, .5);
|
47
|
+
border-right: 1px solid rgba(190, 190, 190, .5);
|
48
|
+
&.scroll-y-cover{
|
49
|
+
position: absolute;
|
50
|
+
right: 0px;
|
51
|
+
top: 0px;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
&-x{
|
55
|
+
width: 100%;
|
56
|
+
height: 14px;
|
57
|
+
float: right;
|
58
|
+
border-top: 1px solid rgba(190, 190, 190, .5);
|
59
|
+
border-bottom: 1px solid rgba(190, 190, 190, .5);
|
60
|
+
&.scroll-x-cover{
|
61
|
+
position: absolute;
|
62
|
+
left: 0px;
|
63
|
+
bottom: 0px;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
&-bar{
|
67
|
+
background: rgba(190, 190, 190, 1);
|
68
|
+
position: absolute;
|
69
|
+
border-radius: 4px;
|
70
|
+
transition: background .2s ease;
|
71
|
+
&-y{
|
72
|
+
width: ~'calc(100% - 4px)';
|
73
|
+
min-height: 14px;
|
74
|
+
}
|
75
|
+
&-x{
|
76
|
+
height: ~'calc(100% - 4px)';
|
77
|
+
min-width: 14px;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
&-place-holder{
|
82
|
+
position: absolute;
|
83
|
+
transition: opacity .3s ease .2s;
|
84
|
+
right: 0px;
|
85
|
+
bottom: 0px;
|
86
|
+
width: 14px;
|
87
|
+
height: 14px;
|
88
|
+
background: rgba(250, 250, 250, 1);
|
89
|
+
}
|
90
|
+
}
|