@hyjiacan/vue-slideout 3.0.0 → 3.0.2
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/API.md +19 -16
- package/API.zh-CN.md +14 -11
- package/README.md +8 -8
- package/dist/slideout.common.js +1127 -1720
- package/dist/slideout.css +1 -1
- package/dist/slideout.umd.js +1127 -1720
- package/dist/slideout.umd.min.js +1 -1
- package/package.json +9 -7
- package/src/assets/langs.json +11 -1
- package/src/components/computed.js +25 -69
- package/src/components/index.js +8 -8
- package/src/components/methods.js +33 -26
- package/src/components/renderer.js +13 -15
- package/src/styles/autosize.less +0 -17
- package/src/styles/header.less +5 -10
- package/src/styles/index.less +8 -23
- package/src/views/Main.vue +3 -0
- package/src/views/demos/CustomizeDemo.vue +1 -1
- package/src/views/demos/FillparentDemo.vue +2 -2
- package/src/views/demos/NestedDemo.vue +85 -0
- package/types/slideout.d.ts +96 -0
package/API.md
CHANGED
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
### Basic
|
|
6
6
|
|
|
7
|
+
#### v-model (required)
|
|
8
|
+
|
|
9
|
+
- type `Boolean`
|
|
10
|
+
|
|
11
|
+
> The visible state of component.
|
|
12
|
+
|
|
7
13
|
#### size (optional)
|
|
8
14
|
|
|
9
15
|
- type `String/Number/Array`
|
|
10
16
|
- default `400px`
|
|
11
17
|
|
|
12
18
|
> The size of component, both `px` and `%` are available;
|
|
19
|
+
>
|
|
13
20
|
> - If it is an array, then: The 1st element is the width, and the 2nd element is the height,
|
|
14
21
|
> - if there is only one element: that makes width equals with height.
|
|
15
22
|
> In this situation, props `resizable`, `min-size`, `max-size` are not available.
|
|
@@ -17,12 +24,6 @@
|
|
|
17
24
|
> You can set value `0/[0]/[0,size]/[size,0]` to make component auto fit content size.
|
|
18
25
|
> In this situation, props `min-size`, `max-size` are available.
|
|
19
26
|
|
|
20
|
-
#### v-model (required)
|
|
21
|
-
|
|
22
|
-
- type `Boolean`
|
|
23
|
-
|
|
24
|
-
> The visible state of component.
|
|
25
|
-
|
|
26
27
|
#### dock (optional)
|
|
27
28
|
|
|
28
29
|
- type `String`
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
#### target (optional)
|
|
41
42
|
|
|
42
43
|
- type `String/HTMLElement`
|
|
43
|
-
- default `
|
|
44
|
+
- default `body`
|
|
44
45
|
|
|
45
46
|
> Append component into the specified element.
|
|
46
47
|
> Both `string`(selector) and `HTMLElement`(DOM object) available.
|
|
@@ -49,7 +50,9 @@
|
|
|
49
50
|
> Note the target element must exist before the component is mounted
|
|
50
51
|
>
|
|
51
52
|
> i.e. the target cannot be rendered by the component itself,
|
|
52
|
-
> and ideally should be outside
|
|
53
|
+
> and ideally should be outside the entire Vue component tree.
|
|
54
|
+
|
|
55
|
+
If you indent to mount it onto it's parent element, you should use `:target="null"`.
|
|
53
56
|
|
|
54
57
|
### Mask layer
|
|
55
58
|
|
|
@@ -181,13 +184,13 @@
|
|
|
181
184
|
|
|
182
185
|
## Slots
|
|
183
186
|
|
|
184
|
-
|
|
187
|
+
### default
|
|
185
188
|
|
|
186
189
|
- args `-`
|
|
187
190
|
|
|
188
191
|
> The content slot.
|
|
189
192
|
|
|
190
|
-
|
|
193
|
+
### header
|
|
191
194
|
|
|
192
195
|
- args `{title}`
|
|
193
196
|
|
|
@@ -195,13 +198,13 @@
|
|
|
195
198
|
> `title` will take no affected(and close button will be removed) if specified this,
|
|
196
199
|
> use `slot-scope="{ title }"` to get prop `title`.
|
|
197
200
|
|
|
198
|
-
|
|
201
|
+
### buttons
|
|
199
202
|
|
|
200
203
|
- args `-`
|
|
201
204
|
|
|
202
205
|
> Extend header buttons.
|
|
203
206
|
|
|
204
|
-
|
|
207
|
+
### footer
|
|
205
208
|
|
|
206
209
|
- args `-`
|
|
207
210
|
|
|
@@ -209,7 +212,7 @@
|
|
|
209
212
|
|
|
210
213
|
## Events
|
|
211
214
|
|
|
212
|
-
|
|
215
|
+
### opening
|
|
213
216
|
|
|
214
217
|
- args e: `{pause: Boolean, resume: Boolean}`
|
|
215
218
|
|
|
@@ -217,20 +220,20 @@
|
|
|
217
220
|
> Emitted before component open, in callback function,
|
|
218
221
|
> assign `e.pause=true` to pause open, and assign `e.resume=true` to resume open (async supported).
|
|
219
222
|
|
|
220
|
-
|
|
223
|
+
### opened
|
|
221
224
|
|
|
222
225
|
- args `-`
|
|
223
226
|
|
|
224
227
|
> Emitted after opened (and after the animation completed).
|
|
225
228
|
|
|
226
|
-
|
|
229
|
+
### closing
|
|
227
230
|
|
|
228
231
|
- args e: `{pause: Boolean, resume: Boolean}`
|
|
229
232
|
|
|
230
233
|
> Emitted before component close, in callback function,
|
|
231
234
|
> assign `e.pause=true` to pause close, and assign `e.resume=true` to resume close (async supported).
|
|
232
235
|
|
|
233
|
-
|
|
236
|
+
### closed
|
|
234
237
|
|
|
235
238
|
- args `-`
|
|
236
239
|
|
package/API.zh-CN.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- 默认值 `400px`
|
|
17
17
|
|
|
18
18
|
> 显示的尺寸, 可以使用单位`px`和`%`;
|
|
19
|
+
>
|
|
19
20
|
> - 当为数组时: 第一个值表示宽度,第二个值表示高度;
|
|
20
21
|
> - 当数组只有一个值时: 表示宽度和高度相同,此时属性 `resizable`, `min-size`, `max-size` 值会被忽略,即不允许改变大小。
|
|
21
22
|
> - ( **自适应尺寸支持** ) 可以设置值为 `0/[0]/[0,size]/[size,0]` 格式, 使组件尺寸自动适应内容。此时 `min-size`, `max-size` 可用。
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
#### target (可选)
|
|
38
39
|
|
|
39
40
|
- 类型 `String/HTMLElement`
|
|
40
|
-
- 默认值 `
|
|
41
|
+
- 默认值 `body`
|
|
41
42
|
|
|
42
43
|
> 设置父元素,可使用字符串(选择器)和(DOM对象)。
|
|
43
44
|
> 在未设置 `target` 时,Slide组件会以 `position: fixed` 的方式显示。
|
|
@@ -46,6 +47,8 @@
|
|
|
46
47
|
>
|
|
47
48
|
> 也就是说,目标元素不能由包含此组件的本身来渲染,并且最好是将其放置在整个Vue组件树之外。
|
|
48
49
|
|
|
50
|
+
若需要使其挂载在像容器上,需要指定 `:target="null"`。
|
|
51
|
+
|
|
49
52
|
### mask 层属性
|
|
50
53
|
|
|
51
54
|
#### show-mask (可选)
|
|
@@ -175,48 +178,48 @@
|
|
|
175
178
|
|
|
176
179
|
## 插槽
|
|
177
180
|
|
|
178
|
-
|
|
181
|
+
### header
|
|
179
182
|
|
|
180
183
|
- 作用域 `{title}`
|
|
181
184
|
|
|
182
185
|
> 头部内容,使用时会占据整个头部,此时属性`title`会无效,
|
|
183
186
|
> 同时也不会显示关闭按钮使用`slot-scope="{ title }"`可以取到属性`title`的值。
|
|
184
187
|
|
|
185
|
-
|
|
188
|
+
### buttons
|
|
186
189
|
|
|
187
190
|
> 头部的扩展按钮部分。
|
|
188
191
|
|
|
189
|
-
|
|
192
|
+
### default
|
|
190
193
|
|
|
191
194
|
> 内容部分。
|
|
192
195
|
|
|
193
|
-
|
|
196
|
+
### footer
|
|
194
197
|
|
|
195
198
|
> 底部内容。
|
|
196
199
|
|
|
197
200
|
## 事件
|
|
198
201
|
|
|
199
|
-
|
|
202
|
+
### opening
|
|
200
203
|
|
|
201
204
|
- 参数 e: `{pause: Boolean, resume: Boolean}`
|
|
202
205
|
|
|
203
206
|
> 在打开前调用,在回调函数内, 设置`e.pause=true` 可以阻止打开,
|
|
204
|
-
> 设置 `e.
|
|
207
|
+
> 设置 `e.resume=true` 可以继续打开(支持异步)。
|
|
205
208
|
|
|
206
|
-
|
|
209
|
+
### opened
|
|
207
210
|
|
|
208
211
|
- 参数 `-`
|
|
209
212
|
|
|
210
213
|
> 在打开后(动画完成)调用。
|
|
211
214
|
|
|
212
|
-
|
|
215
|
+
### closing
|
|
213
216
|
|
|
214
217
|
- 参数 e: `{pause: Boolean, resume: Boolean}`
|
|
215
218
|
|
|
216
219
|
> 在关闭前调用,在回调函数内, 设置`e.pause=true` 可以阻止关闭,
|
|
217
|
-
> 设置 `e.
|
|
220
|
+
> 设置 `e.resume=true` 可以继续关闭(支持异步)。
|
|
218
221
|
|
|
219
|
-
|
|
222
|
+
### closed
|
|
220
223
|
|
|
221
224
|
- 参数 `-`
|
|
222
225
|
|
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|

|
|
7
7
|
[](https://npmcharts.com/compare/@hyjiacan/vue-slideout?minimal=true)
|
|
8
8
|
[](https://coveralls.io/github/hyjiacan/vue-slideout?branch=master)
|
|
9
|
-
[](https://www.jsdelivr.com/package/npm/@hyjiacan/vue-slideout)
|
|
9
|
+
[](https://www.jsdelivr.com/package/npm/@hyjiacan/vue-slideout)
|
|
10
10
|
|
|
11
11
|
A Slide-Out component for Vue3
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Dependencies
|
|
14
14
|
|
|
15
15
|
- Vue.js 3.x
|
|
16
16
|
- Less
|
|
@@ -47,16 +47,16 @@ The newest version
|
|
|
47
47
|
|
|
48
48
|
```html
|
|
49
49
|
|
|
50
|
-
<script src="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout/
|
|
51
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout/
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout/dist/slideout.umd.min.js"></script>
|
|
51
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout/dist/slideout.css"/>
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Specified version
|
|
55
55
|
|
|
56
56
|
```html
|
|
57
57
|
|
|
58
|
-
<script src="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout@<VERSION>/
|
|
59
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout@<VERSION>/
|
|
58
|
+
<script src="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout@<VERSION>/dist/slideout.umd.min.js"></script>
|
|
59
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout@<VERSION>/dist/slideout.css"/>
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
> **unpkg** is also available: instead *cdn.jsdelivr.net* with *unpkg.com*.
|
|
@@ -72,7 +72,7 @@ Specified version
|
|
|
72
72
|
```javascript
|
|
73
73
|
import Vue from 'vue'
|
|
74
74
|
import Slideout from '@hyjiacan/vue-slideout'
|
|
75
|
-
import '@hyjiacan/vue-slideout/
|
|
75
|
+
import '@hyjiacan/vue-slideout/dist/slideout.css'
|
|
76
76
|
|
|
77
77
|
// import Slideout component, and set the defaults props
|
|
78
78
|
Vue.use(Slideout, {
|
|
@@ -92,7 +92,7 @@ Vue.use(Slideout, {
|
|
|
92
92
|
</template>
|
|
93
93
|
<script>
|
|
94
94
|
import Slideout from '@hyjiacan/vue-slideout'
|
|
95
|
-
import '@hyjiacan/vue-slideout/
|
|
95
|
+
import '@hyjiacan/vue-slideout/dist/slideout.css'
|
|
96
96
|
|
|
97
97
|
export default {
|
|
98
98
|
name: 'Foobar',
|