@opentiny/vue-docs 3.26.8 → 3.27.1
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/demos/apis/base-select.js +13 -0
- package/demos/apis/calendar-view.js +12 -0
- package/demos/apis/color-picker.js +16 -0
- package/demos/apis/color-select-panel.js +14 -0
- package/demos/apis/config-provider.js +2 -1
- package/demos/apis/date-picker.js +52 -0
- package/demos/apis/dialog-box.js +16 -4
- package/demos/apis/drawer.js +22 -0
- package/demos/apis/exception.js +43 -27
- package/demos/apis/grid.js +38 -3
- package/demos/apis/guide.js +14 -0
- package/demos/apis/pager.js +3 -3
- package/demos/apis/query-builder.js +346 -1
- package/demos/apis/select.js +41 -0
- package/demos/apis/space.js +99 -0
- package/demos/apis/steps.js +15 -0
- package/demos/apis/time-picker.js +28 -0
- package/demos/apis/time-select.js +30 -0
- package/demos/apis/tree-menu.js +14 -0
- package/demos/mobile-first/app/calendar-view/basic-usage.vue +1 -1
- package/demos/mobile-first/app/exception/webdoc/exception.js +4 -4
- package/demos/mobile-first/app/load-list/webdoc/load-list.en.md +1 -1
- package/demos/mobile-first/app/space/basic-usage-composition-api.vue +41 -0
- package/demos/mobile-first/app/space/basic-usage.spec.ts +37 -0
- package/demos/mobile-first/app/space/basic-usage.vue +37 -0
- package/demos/mobile-first/app/space/space-align-composition-api.vue +37 -0
- package/demos/mobile-first/app/space/space-align.spec.ts +24 -0
- package/demos/mobile-first/app/space/space-align.vue +37 -0
- package/demos/mobile-first/app/space/space-direction-composition-api.vue +32 -0
- package/demos/mobile-first/app/space/space-direction.spec.ts +17 -0
- package/demos/mobile-first/app/space/space-direction.vue +32 -0
- package/demos/mobile-first/app/space/space-justify-composition-api.vue +44 -0
- package/demos/mobile-first/app/space/space-justify.spec.ts +18 -0
- package/demos/mobile-first/app/space/space-justify.vue +39 -0
- package/demos/mobile-first/app/space/space-order-composition-api.vue +14 -0
- package/demos/mobile-first/app/space/space-order.spec.ts +13 -0
- package/demos/mobile-first/app/space/space-order.vue +14 -0
- package/demos/mobile-first/app/space/space-size-composition-api.vue +39 -0
- package/demos/mobile-first/app/space/space-size.spec.ts +37 -0
- package/demos/mobile-first/app/space/space-size.vue +39 -0
- package/demos/mobile-first/app/space/space-wrap-composition-api.vue +31 -0
- package/demos/mobile-first/app/space/space-wrap.spec.ts +25 -0
- package/demos/mobile-first/app/space/space-wrap.vue +31 -0
- package/demos/mobile-first/app/space/webdoc/space.cn.md +9 -0
- package/demos/mobile-first/app/space/webdoc/space.en.md +9 -0
- package/demos/mobile-first/app/space/webdoc/space.js +98 -0
- package/demos/mobile-first/menus.js +3 -1
- package/demos/pc/app/calendar-view/basic-usage-composition-api.vue +1 -1
- package/demos/pc/app/calendar-view/basic-usage.vue +1 -1
- package/demos/pc/app/carousel/webdoc/carousel.js +2 -1
- package/demos/pc/app/color-picker/linear-gradient-composition-api.vue +20 -0
- package/demos/pc/app/color-picker/linear-gradient.spec.ts +10 -0
- package/demos/pc/app/color-picker/linear-gradient.vue +28 -0
- package/demos/pc/app/color-picker/webdoc/color-picker.js +27 -0
- package/demos/pc/app/color-select-panel/linear-gradient-composition-api.vue +38 -0
- package/demos/pc/app/color-select-panel/linear-gradient.spec.ts +71 -0
- package/demos/pc/app/color-select-panel/linear-gradient.vue +45 -0
- package/demos/pc/app/color-select-panel/webdoc/color-select-panel.js +12 -0
- package/demos/pc/app/config-provider/webdoc/config-provider.js +2 -1
- package/demos/pc/app/date-panel/basic-usage.vue +19 -8
- package/demos/pc/app/date-panel/custom-weeks.vue +19 -9
- package/demos/pc/app/date-panel/disabled-date.vue +29 -19
- package/demos/pc/app/date-panel/event.vue +38 -31
- package/demos/pc/app/date-panel/format.vue +15 -5
- package/demos/pc/app/date-panel/readonly.vue +19 -8
- package/demos/pc/app/date-panel/shortcuts.vue +182 -176
- package/demos/pc/app/date-panel/unlink-panels.vue +15 -5
- package/demos/pc/app/date-picker/now-composition-api.vue +4 -1
- package/demos/pc/app/date-picker/now.vue +6 -2
- package/demos/pc/app/date-picker/slot-composition-api.vue +112 -0
- package/demos/pc/app/date-picker/slot.spec.ts +41 -0
- package/demos/pc/app/date-picker/slot.vue +119 -0
- package/demos/pc/app/date-picker/webdoc/date-picker.js +12 -0
- package/demos/pc/app/dialog-box/before-close-composition-api.vue +65 -0
- package/demos/pc/app/dialog-box/before-close.spec.ts +6 -0
- package/demos/pc/app/dialog-box/before-close.vue +71 -0
- package/demos/pc/app/dialog-box/webdoc/dialog-box.js +16 -0
- package/demos/pc/app/dialog-select/nest-tree-single.spec.ts +4 -7
- package/demos/pc/app/drawer/webdoc/drawer.js +2 -1
- package/demos/pc/app/exception/basic-usage-composition-api.vue +15 -0
- package/demos/pc/app/exception/basic-usage.vue +21 -0
- package/demos/pc/app/exception/button-text-composition-api.vue +13 -0
- package/demos/pc/app/exception/button-text.vue +21 -0
- package/demos/pc/app/exception/component-page-composition-api.vue +44 -0
- package/demos/pc/app/exception/component-page.vue +55 -0
- package/demos/pc/app/exception/page-empty-composition-api.vue +7 -0
- package/demos/pc/app/exception/page-empty.vue +13 -0
- package/demos/pc/app/exception/slot-composition-api.vue +29 -0
- package/demos/pc/app/exception/slot.vue +23 -0
- package/demos/pc/app/exception/sub-message-composition-api.vue +7 -0
- package/demos/pc/app/exception/sub-message.vue +13 -0
- package/demos/pc/app/exception/webdoc/exception.cn.md +5 -0
- package/demos/pc/app/exception/webdoc/exception.en.md +5 -0
- package/demos/pc/app/exception/webdoc/exception.js +84 -0
- package/demos/pc/app/grid/custom/default-customs-composition-api.vue +66 -0
- package/demos/pc/app/grid/custom/default-customs.spec.ts +9 -0
- package/demos/pc/app/grid/custom/default-customs.vue +75 -0
- package/demos/pc/app/grid/mouse-keyboard/mouse-config-hover-composition-api.vue +70 -0
- package/demos/pc/app/grid/mouse-keyboard/mouse-config-hover.vue +79 -0
- package/demos/pc/app/grid/validation/highlight-error-composition-api.vue +183 -0
- package/demos/pc/app/grid/validation/highlight-error.vue +192 -0
- package/demos/pc/app/grid/webdoc/grid-custom.js +11 -0
- package/demos/pc/app/grid/webdoc/grid-editor.js +2 -2
- package/demos/pc/app/grid/webdoc/grid-mouse-keyboard.js +9 -0
- package/demos/pc/app/grid/webdoc/grid-validation.js +9 -0
- package/demos/pc/app/guide/mask-composition-api.vue +31 -0
- package/demos/pc/app/guide/mask.spec.ts +13 -0
- package/demos/pc/app/guide/mask.vue +41 -0
- package/demos/pc/app/guide/webdoc/guide.js +12 -0
- package/demos/pc/app/input/resize.spec.ts +1 -1
- package/demos/pc/app/notify/manual-close-composition-api.vue +9 -11
- package/demos/pc/app/notify/manual-close.spec.ts +1 -1
- package/demos/pc/app/notify/manual-close.vue +9 -11
- package/demos/pc/app/notify/verticalOffset.spec.ts +3 -1
- package/demos/pc/app/query-builder/handle.vue +558 -0
- package/demos/pc/app/query-builder/limit.vue +555 -0
- package/demos/pc/app/query-builder/webdoc/query-builder.js +29 -1
- package/demos/pc/app/radio/dynamic-disable.vue +1 -1
- package/demos/pc/app/space/basic-usage-composition-api.vue +41 -0
- package/demos/pc/app/space/basic-usage.spec.ts +37 -0
- package/demos/pc/app/space/basic-usage.vue +37 -0
- package/demos/pc/app/space/space-align-composition-api.vue +37 -0
- package/demos/pc/app/space/space-align.spec.ts +24 -0
- package/demos/pc/app/space/space-align.vue +37 -0
- package/demos/pc/app/space/space-direction-composition-api.vue +32 -0
- package/demos/pc/app/space/space-direction.spec.ts +17 -0
- package/demos/pc/app/space/space-direction.vue +32 -0
- package/demos/pc/app/space/space-justify-composition-api.vue +44 -0
- package/demos/pc/app/space/space-justify.spec.ts +18 -0
- package/demos/pc/app/space/space-justify.vue +39 -0
- package/demos/pc/app/space/space-order-composition-api.vue +14 -0
- package/demos/pc/app/space/space-order.spec.ts +13 -0
- package/demos/pc/app/space/space-order.vue +14 -0
- package/demos/pc/app/space/space-size-composition-api.vue +39 -0
- package/demos/pc/app/space/space-size.spec.ts +37 -0
- package/demos/pc/app/space/space-size.vue +39 -0
- package/demos/pc/app/space/space-wrap-composition-api.vue +31 -0
- package/demos/pc/app/space/space-wrap.spec.ts +25 -0
- package/demos/pc/app/space/space-wrap.vue +31 -0
- package/demos/pc/app/space/webdoc/space.cn.md +9 -0
- package/demos/pc/app/space/webdoc/space.en.md +9 -0
- package/demos/pc/app/space/webdoc/space.js +98 -0
- package/demos/pc/app/steps/slot-icon-composition-api.vue +46 -0
- package/demos/pc/app/steps/slot-icon.vue +54 -0
- package/demos/pc/app/steps/webdoc/steps.js +12 -0
- package/demos/pc/app/tree-menu/events-composition-api.vue +4 -0
- package/demos/pc/app/tree-menu/events.vue +4 -0
- package/demos/pc/app/tree-menu/webdoc/tree-menu.js +2 -2
- package/demos/pc/app/tree-menu/with-icon-composition-api.vue +149 -24
- package/demos/pc/app/tree-menu/with-icon.spec.ts +1 -1
- package/demos/pc/app/tree-menu/with-icon.vue +149 -24
- package/demos/pc/menus.js +16 -0
- package/demos/pc/webdoc/changelog.md +209 -177
- package/env/.env.saas +1 -1
- package/env/.env.saaspages +9 -0
- package/package.json +21 -20
- package/playground/App.vue +2 -2
- package/src/components/anchor.vue +19 -72
- package/src/views/components-doc/common.vue +76 -12
- /package/demos/pc/app/user/{nodata-text-composition-api.vue → no-data-text-composition-api.vue} +0 -0
- /package/demos/pc/app/user/{nodata-text.vue → no-data-text.vue} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-footer-slot">
|
|
3
|
+
<tiny-date-picker v-model="value" type="date" placeholder="请选择日期">
|
|
4
|
+
<template #footer="{ confirm }">
|
|
5
|
+
<div class="custom-footer">
|
|
6
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
</tiny-date-picker>
|
|
10
|
+
<tiny-date-picker v-model="dateTimeValue" type="datetime" placeholder="请选择日期时间">
|
|
11
|
+
<template #footer="{ confirm, changeToNow }">
|
|
12
|
+
<div class="custom-footer">
|
|
13
|
+
<tiny-button type="default" @click="changeToNow">自定义此刻</tiny-button>
|
|
14
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
</tiny-date-picker>
|
|
18
|
+
<tiny-date-picker v-model="weekValue" type="week" placeholder="请选择周">
|
|
19
|
+
<template #footer="{ confirm }">
|
|
20
|
+
<div class="custom-footer end">
|
|
21
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
</tiny-date-picker>
|
|
25
|
+
<tiny-date-picker v-model="monthValue" type="month" placeholder="请选择月份">
|
|
26
|
+
<template #footer="{ confirm }">
|
|
27
|
+
<div class="custom-footer end">
|
|
28
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
</tiny-date-picker>
|
|
32
|
+
<tiny-date-picker v-model="yearValue" type="year" placeholder="请选择年份">
|
|
33
|
+
<template #footer="{ confirm }">
|
|
34
|
+
<div class="custom-footer end">
|
|
35
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</tiny-date-picker>
|
|
39
|
+
<tiny-date-picker v-model="valueRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
40
|
+
<template #footer="{ confirm, clear }">
|
|
41
|
+
<div class="custom-footer">
|
|
42
|
+
<tiny-button type="default" @click="clear">自定义清空</tiny-button>
|
|
43
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</tiny-date-picker>
|
|
47
|
+
<tiny-date-picker
|
|
48
|
+
v-model="valueDateTimeRange"
|
|
49
|
+
type="datetimerange"
|
|
50
|
+
start-placeholder="开始日期时间"
|
|
51
|
+
end-placeholder="结束日期时间"
|
|
52
|
+
>
|
|
53
|
+
<template #footer="{ confirm, clear }">
|
|
54
|
+
<div class="custom-footer">
|
|
55
|
+
<tiny-button type="default" @click="clear">自定义清空</tiny-button>
|
|
56
|
+
<tiny-button type="primary" @click="confirm">自定义按钮</tiny-button>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
</tiny-date-picker>
|
|
60
|
+
<tiny-date-picker
|
|
61
|
+
v-model="valueMonthRange"
|
|
62
|
+
type="monthrange"
|
|
63
|
+
start-placeholder="开始月份"
|
|
64
|
+
end-placeholder="结束月份"
|
|
65
|
+
>
|
|
66
|
+
<template #footer>
|
|
67
|
+
<div class="custom-footer end">
|
|
68
|
+
<tiny-button type="primary">自定义按钮</tiny-button>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</tiny-date-picker>
|
|
72
|
+
<tiny-date-picker v-model="valueYearRange" type="yearrange" start-placeholder="开始年份" end-placeholder="结束年份">
|
|
73
|
+
<template #footer>
|
|
74
|
+
<div class="custom-footer end">
|
|
75
|
+
<tiny-button type="primary">自定义按钮</tiny-button>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
</tiny-date-picker>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<script>
|
|
83
|
+
import { TinyDatePicker, TinyButton } from '@opentiny/vue'
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
components: { TinyDatePicker, TinyButton },
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
value: '',
|
|
90
|
+
dateTimeValue: '',
|
|
91
|
+
weekValue: '',
|
|
92
|
+
monthValue: '',
|
|
93
|
+
quarterValue: '',
|
|
94
|
+
yearValue: '',
|
|
95
|
+
valueRange: [],
|
|
96
|
+
valueDateTimeRange: [],
|
|
97
|
+
valueMonthRange: [],
|
|
98
|
+
valueYearRange: []
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style scoped lang="less">
|
|
105
|
+
.demo-footer-slot {
|
|
106
|
+
width: 360px;
|
|
107
|
+
gap: 10px;
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
}
|
|
111
|
+
.custom-footer {
|
|
112
|
+
display: flex;
|
|
113
|
+
width: 100%;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
}
|
|
116
|
+
.end {
|
|
117
|
+
justify-content: flex-end;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -272,6 +272,18 @@ export default {
|
|
|
272
272
|
'en-US': '<p>The main events are focus, blur and change.</p>'
|
|
273
273
|
},
|
|
274
274
|
codeFiles: ['events.vue']
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
demoId: 'slot',
|
|
278
|
+
name: {
|
|
279
|
+
'zh-CN': '插槽',
|
|
280
|
+
'en-US': 'Slot'
|
|
281
|
+
},
|
|
282
|
+
desc: {
|
|
283
|
+
'zh-CN': '<p>通过 `#footer` 作用域插槽自定义显示内容。</p>',
|
|
284
|
+
'en-US': '<p>Through the `#footer` scope slot to customize the display content.</p>'
|
|
285
|
+
},
|
|
286
|
+
codeFiles: ['slot.vue']
|
|
275
287
|
}
|
|
276
288
|
],
|
|
277
289
|
features: [
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-button @click="box1 = true" title="属性拦截 Dialog示例">属性拦截 Dialog</tiny-button>
|
|
4
|
+
<tiny-button @click="box2 = true" title="事件拦截 Dialog示例">事件拦截 Dialog</tiny-button>
|
|
5
|
+
|
|
6
|
+
<tiny-dialog-box ref="box1Ref" v-model:visible="box1" title="消息" width="30%" :before-close="beforeCloseProp">
|
|
7
|
+
<span>当前窗口有50%的概率关闭</span>
|
|
8
|
+
<template #footer>
|
|
9
|
+
<tiny-button @click="handleBox1Close">取 消</tiny-button>
|
|
10
|
+
<tiny-button type="primary" @click="handleBox1Close">确 定</tiny-button>
|
|
11
|
+
</template>
|
|
12
|
+
</tiny-dialog-box>
|
|
13
|
+
|
|
14
|
+
<tiny-dialog-box ref="box2Ref" v-model:visible="box2" title="消息" width="30%" @before-close="onBeforeClose">
|
|
15
|
+
<span>当前窗口有50%的概率关闭</span>
|
|
16
|
+
<template #footer>
|
|
17
|
+
<tiny-button @click="handleBox2Close">取 消</tiny-button>
|
|
18
|
+
<tiny-button type="primary" @click="handleBox2Close">确 定</tiny-button>
|
|
19
|
+
</template>
|
|
20
|
+
</tiny-dialog-box>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="jsx">
|
|
25
|
+
import { ref } from 'vue'
|
|
26
|
+
import { TinyButton, TinyDialogBox, Modal } from '@opentiny/vue'
|
|
27
|
+
|
|
28
|
+
const box1 = ref(false)
|
|
29
|
+
const box2 = ref(false)
|
|
30
|
+
const box1Ref = ref()
|
|
31
|
+
const box2Ref = ref()
|
|
32
|
+
|
|
33
|
+
function beforeCloseProp(type) {
|
|
34
|
+
// 模拟异步校验,是否需要手动关闭
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
if (Math.random() > 0.5) {
|
|
37
|
+
box1Ref.value.hide(type) // 手动关闭,使用 box1.value = false 同样效果
|
|
38
|
+
} else {
|
|
39
|
+
Modal.alert('随机值过小,校验失败')
|
|
40
|
+
}
|
|
41
|
+
}, 1000)
|
|
42
|
+
|
|
43
|
+
return false // 拦截关闭
|
|
44
|
+
}
|
|
45
|
+
function onBeforeClose(event, hideFn) {
|
|
46
|
+
// 模拟异步校验,是否需要手动关闭
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
if (Math.random() > 0.5) {
|
|
49
|
+
hideFn() // 手动关闭,使用 box2.value = false 同样效果
|
|
50
|
+
} else {
|
|
51
|
+
Modal.alert('随机值过小,校验失败')
|
|
52
|
+
}
|
|
53
|
+
}, 1000)
|
|
54
|
+
|
|
55
|
+
event.preventDefault() // 拦截关闭
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function handleBox1Close() {
|
|
59
|
+
box1Ref.value.handleClose()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handleBox2Close() {
|
|
63
|
+
box2Ref.value.handleClose()
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-button @click="box1 = true" title="属性拦截 Dialog示例">属性拦截 Dialog</tiny-button>
|
|
4
|
+
<tiny-button @click="box2 = true" title="事件拦截 Dialog示例">事件拦截 Dialog</tiny-button>
|
|
5
|
+
|
|
6
|
+
<tiny-dialog-box ref="box1Ref" v-model:visible="box1" title="消息" width="30%" :before-close="beforeCloseProp">
|
|
7
|
+
<span>当前窗口有50%的概率关闭</span>
|
|
8
|
+
<template #footer>
|
|
9
|
+
<tiny-button @click="handleBox1Close">取 消</tiny-button>
|
|
10
|
+
<tiny-button type="primary" @click="handleBox1Close">确 定</tiny-button>
|
|
11
|
+
</template>
|
|
12
|
+
</tiny-dialog-box>
|
|
13
|
+
|
|
14
|
+
<tiny-dialog-box ref="box2Ref" v-model:visible="box2" title="消息" width="30%" @before-close="onBeforeClose">
|
|
15
|
+
<span>当前窗口有50%的概率关闭</span>
|
|
16
|
+
<template #footer>
|
|
17
|
+
<tiny-button @click="handleBox2Close">取 消</tiny-button>
|
|
18
|
+
<tiny-button type="primary" @click="handleBox2Close">确 定</tiny-button>
|
|
19
|
+
</template>
|
|
20
|
+
</tiny-dialog-box>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script lang="jsx">
|
|
25
|
+
import { TinyButton, TinyDialogBox, Modal } from '@opentiny/vue'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
components: {
|
|
29
|
+
TinyButton,
|
|
30
|
+
TinyDialogBox
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
box1: false,
|
|
35
|
+
box2: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
beforeCloseProp(type) {
|
|
40
|
+
// 模拟异步校验,是否需要手动关闭
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
if (Math.random() > 0.5) {
|
|
43
|
+
this.$refs.box1Ref.hide(type) // 手动关闭,使用 box1.value = false 同样效果
|
|
44
|
+
} else {
|
|
45
|
+
Modal.alert('随机值过小,校验失败')
|
|
46
|
+
}
|
|
47
|
+
}, 1000)
|
|
48
|
+
|
|
49
|
+
return false // 拦截关闭
|
|
50
|
+
},
|
|
51
|
+
onBeforeClose(event, hideFn) {
|
|
52
|
+
// 模拟异步校验,是否需要手动关闭
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
if (Math.random() > 0.5) {
|
|
55
|
+
hideFn() // 手动关闭,使用 box2.value = false 同样效果
|
|
56
|
+
} else {
|
|
57
|
+
Modal.alert('随机值过小,校验失败')
|
|
58
|
+
}
|
|
59
|
+
}, 1000)
|
|
60
|
+
|
|
61
|
+
event.preventDefault() // 拦截关闭
|
|
62
|
+
},
|
|
63
|
+
handleBox1Close() {
|
|
64
|
+
this.$refs.box1Ref.handleClose()
|
|
65
|
+
},
|
|
66
|
+
handleBox2Close() {
|
|
67
|
+
this.$refs.box2Ref.handleClose()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
@@ -294,6 +294,22 @@ export default {
|
|
|
294
294
|
},
|
|
295
295
|
codeFiles: ['open-close-events.vue']
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
demoId: 'before-close',
|
|
299
|
+
name: {
|
|
300
|
+
'zh-CN': '关闭前拦截',
|
|
301
|
+
'en-US': 'before close blocking'
|
|
302
|
+
},
|
|
303
|
+
desc: {
|
|
304
|
+
'zh-CN': `
|
|
305
|
+
可通过设置属性<code>before-close</code>,设置对话框关闭前时触发的拦截函数。
|
|
306
|
+
也可以通过绑定事件<code>before-close</code>,但它们的用法有细微差异,详见下面示例`,
|
|
307
|
+
'en-US': `
|
|
308
|
+
You can set the <code>before-close</code> property to define a function that triggers before the dialog box closes.
|
|
309
|
+
You can also bind the <code>before-close</code> event, but their usage differs slightly. See the example below.`
|
|
310
|
+
},
|
|
311
|
+
codeFiles: ['before-close.vue']
|
|
312
|
+
},
|
|
297
313
|
{
|
|
298
314
|
demoId: 'transition-effect',
|
|
299
315
|
name: {
|
|
@@ -13,13 +13,10 @@ test('dialogSelect 树单选', async ({ page }) => {
|
|
|
13
13
|
expect(iconNode?.includes('tiny-checkbox')).toBe(false)
|
|
14
14
|
|
|
15
15
|
let current
|
|
16
|
-
current = await page.
|
|
16
|
+
current = await page.getByRole('treeitem', { name: '二级 4' }).locator('label')
|
|
17
17
|
await current.click()
|
|
18
|
-
expect(
|
|
18
|
+
expect(current).toHaveClass(/is-checked/)
|
|
19
19
|
|
|
20
|
-
current = await page.
|
|
21
|
-
await current.
|
|
22
|
-
expect(await current.locator('input[type="radio"]').isChecked()).toBe(true)
|
|
23
|
-
current = await page.getByText('201一级')
|
|
24
|
-
expect(await current.locator('input[type="radio"]').isChecked()).toBe(false)
|
|
20
|
+
current = await page.getByText('二级 5')
|
|
21
|
+
await expect(current).not.toHaveClass(/is-checked/)
|
|
25
22
|
})
|
|
@@ -47,7 +47,8 @@ export default {
|
|
|
47
47
|
'<p>通过 <code>tips-props</code> 属性可自定义标题帮助提示信息,具体属性配置参考 <a href="tooltip#tooltip">ToolTip 组件</a> 的 props 说明。</p>',
|
|
48
48
|
'en-US': ''
|
|
49
49
|
},
|
|
50
|
-
codeFiles: ['tips-props.vue']
|
|
50
|
+
codeFiles: ['tips-props.vue'],
|
|
51
|
+
hideSaas: true
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
demoId: 'width',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="exception-demo">
|
|
3
|
+
<tiny-exception type="nodata"></tiny-exception>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyException } from '@opentiny/vue'
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<style scoped>
|
|
12
|
+
.exception-demo {
|
|
13
|
+
padding: 20px;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="exception-demo">
|
|
3
|
+
<tiny-exception type="nodata"></tiny-exception>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyException } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyException
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped>
|
|
18
|
+
.exception-demo {
|
|
19
|
+
padding: 20px;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-exception type="pagenoperm">
|
|
3
|
+
<tiny-button type="primary" @click="test">自定义按钮</tiny-button>
|
|
4
|
+
</tiny-exception>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyException, TinyModal, TinyButton } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
const test = () => {
|
|
11
|
+
TinyModal.message({ status: 'info', message: '自定义按钮被点击' })
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-exception type="pagenoperm">
|
|
3
|
+
<tiny-button type="primary" @click="test">立即新建</tiny-button>
|
|
4
|
+
</tiny-exception>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyException, TinyModal, TinyButton } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyException,
|
|
13
|
+
TinyButton
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
test() {
|
|
17
|
+
TinyModal.message({ status: 'info', message: '自定义按钮被点击' })
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-grid :data="tableData" height="300">
|
|
4
|
+
<tiny-grid-column type="index" width="5%"></tiny-grid-column>
|
|
5
|
+
<tiny-grid-column field="name" title="名称"></tiny-grid-column>
|
|
6
|
+
<tiny-grid-column field="area" title="区域"></tiny-grid-column>
|
|
7
|
+
<tiny-grid-column field="address" title="地址"></tiny-grid-column>
|
|
8
|
+
<tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column>
|
|
9
|
+
<template #empty>
|
|
10
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
11
|
+
</template>
|
|
12
|
+
</tiny-grid>
|
|
13
|
+
<div class="demo-split">
|
|
14
|
+
<tiny-split v-model="split2">
|
|
15
|
+
<template #left>
|
|
16
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
17
|
+
</template>
|
|
18
|
+
<template #right>
|
|
19
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
20
|
+
</template>
|
|
21
|
+
</tiny-split>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
import { TinyGrid, TinyGridColumn, TinyException, TinySplit } from '@opentiny/vue'
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
|
|
30
|
+
const tableData = ref([])
|
|
31
|
+
const split2 = ref(0.4)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
.demo-split {
|
|
36
|
+
height: 200px;
|
|
37
|
+
border: 1px solid #d9d9d9;
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.demo-split-pane {
|
|
42
|
+
padding: 10px;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-grid :data="tableData" height="300">
|
|
4
|
+
<tiny-grid-column type="index" width="5%"></tiny-grid-column>
|
|
5
|
+
<tiny-grid-column field="name" title="名称"></tiny-grid-column>
|
|
6
|
+
<tiny-grid-column field="area" title="区域"></tiny-grid-column>
|
|
7
|
+
<tiny-grid-column field="address" title="地址"></tiny-grid-column>
|
|
8
|
+
<tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column>
|
|
9
|
+
<template #empty>
|
|
10
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
11
|
+
</template>
|
|
12
|
+
</tiny-grid>
|
|
13
|
+
<div class="demo-split">
|
|
14
|
+
<tiny-split v-model="split2">
|
|
15
|
+
<template #left>
|
|
16
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
17
|
+
</template>
|
|
18
|
+
<template #right>
|
|
19
|
+
<tiny-exception component-page type="nodata"></tiny-exception>
|
|
20
|
+
</template>
|
|
21
|
+
</tiny-split>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { TinyGrid, TinyGridColumn, TinyException, TinySplit } from '@opentiny/vue'
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
components: {
|
|
31
|
+
TinyGrid,
|
|
32
|
+
TinyGridColumn,
|
|
33
|
+
TinyException,
|
|
34
|
+
TinySplit
|
|
35
|
+
},
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
tableData: [],
|
|
39
|
+
split2: 0.4
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.demo-split {
|
|
47
|
+
height: 200px;
|
|
48
|
+
border: 1px solid #d9d9d9;
|
|
49
|
+
margin-bottom: 20px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.demo-split-pane {
|
|
53
|
+
padding: 10px;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-exception type="pagenoperm">
|
|
3
|
+
<template #icon>
|
|
4
|
+
<TinyIconSuccess class="custom-icon" />
|
|
5
|
+
</template>
|
|
6
|
+
<template #content>
|
|
7
|
+
<div class="content">content插槽</div>
|
|
8
|
+
<tiny-button type="primary">自定义按钮</tiny-button>
|
|
9
|
+
</template>
|
|
10
|
+
</tiny-exception>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { TinyException, TinyButton } from '@opentiny/vue'
|
|
15
|
+
import { IconSuccess } from '@opentiny/vue-icon'
|
|
16
|
+
|
|
17
|
+
const TinyIconSuccess = IconSuccess()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.content {
|
|
22
|
+
padding-bottom: 15px;
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
}
|
|
25
|
+
.custom-icon {
|
|
26
|
+
width: 50px;
|
|
27
|
+
height: 50px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-exception>
|
|
3
|
+
<template #icon>
|
|
4
|
+
<IconSuccess />
|
|
5
|
+
</template>
|
|
6
|
+
<template #content>
|
|
7
|
+
<div>content插槽</div>
|
|
8
|
+
</template>
|
|
9
|
+
<tiny-button type="primary">立即新建</tiny-button>
|
|
10
|
+
</tiny-exception>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { TinyException } from '@opentiny/vue'
|
|
15
|
+
import { IconSuccess } from '@opentiny/vue-icon'
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
components: {
|
|
19
|
+
TinyException,
|
|
20
|
+
IconSuccess: IconSuccess()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|