@opentiny/vue-docs 2.0.4 → 2.0.6
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/app/alert/close-text-composition-api.vue +2 -3
- package/demos/app/alert/close-text.vue +2 -3
- package/demos/app/anchor/on-change-composition-api.vue +2 -3
- package/demos/app/anchor/on-change.vue +2 -3
- package/demos/app/chart/webdoc/chart.js +13 -13
- package/demos/app/dept/before-confirm-composition-api.vue +2 -3
- package/demos/app/dept/before-confirm.vue +2 -3
- package/demos/app/file-upload/abort-quest-composition-api.vue +2 -3
- package/demos/app/file-upload/abort-quest.vue +2 -3
- package/demos/app/file-upload/custom-prefix-composition-api.vue +3 -4
- package/demos/app/file-upload/custom-prefix.vue +3 -4
- package/demos/app/file-upload/custom-upload-request-composition-api.vue +2 -3
- package/demos/app/file-upload/custom-upload-request.vue +2 -3
- package/demos/app/file-upload/drag-upload-composition-api.vue +2 -3
- package/demos/app/file-upload/drag-upload.vue +2 -3
- package/demos/app/file-upload/jalor-request-composition-api.vue +2 -3
- package/demos/app/file-upload/jalor-request.vue +2 -3
- package/demos/app/file-upload/max-file-count-composition-api.vue +2 -3
- package/demos/app/file-upload/max-file-count.vue +2 -3
- package/demos/app/file-upload/prevent-delete-file-composition-api.vue +2 -3
- package/demos/app/file-upload/prevent-delete-file.vue +2 -3
- package/demos/app/file-upload/prevent-upload-file-composition-api.vue +2 -3
- package/demos/app/file-upload/prevent-upload-file.vue +2 -3
- package/demos/app/file-upload/upload-events-composition-api.vue +9 -10
- package/demos/app/file-upload/upload-events.vue +9 -10
- package/demos/app/file-upload/upload-request-composition-api.vue +2 -3
- package/demos/app/file-upload/upload-request.vue +2 -3
- package/demos/app/form/display-only-composition-api.vue +1 -2
- package/demos/app/form/display-only.vue +1 -2
- package/demos/app/form/form-validate-field-composition-api.vue +151 -0
- package/demos/app/form/form-validate-field.vue +163 -0
- package/demos/app/form/frequently-used-form-composition-api.vue +3 -3
- package/demos/app/form/frequently-used-form.vue +2 -3
- package/demos/app/form/no-validate-to-add-composition-api.vue +4 -4
- package/demos/app/form/no-validate-to-add.vue +4 -4
- package/demos/app/form/size-composition-api.vue +3 -3
- package/demos/app/form/size.vue +2 -3
- package/demos/app/form/webdoc/form.js +12 -1
- package/demos/app/grid/event/toolbar-button-click-event-composition-api.vue +5 -6
- package/demos/app/grid/event/toolbar-button-click-event.vue +1 -2
- package/demos/app/grid/grid_Example/gridValid/before-submit-validation-composition-api.vue +3 -4
- package/demos/app/grid/grid_Example/gridValid/before-submit-validation.vue +3 -4
- package/demos/app/grid/grid_Example/gridValid/select-validation-composition-api.vue +4 -5
- package/demos/app/grid/grid_Example/gridValid/select-validation.vue +4 -5
- package/demos/app/grid/grid_Example/gridValid/validation-scroll-to-col-composition-api.vue +9 -4
- package/demos/app/grid/grid_Example/gridValid/validation-scroll-to-col.vue +3 -4
- package/demos/app/grid/grid_Example/shortcutMenu/footer-menu-composition-api.vue +1 -2
- package/demos/app/grid/grid_Example/shortcutMenu/footer-menu.vue +1 -2
- package/demos/app/grid/grid_Example/shortcutMenu/header-menu-composition-api.vue +1 -2
- package/demos/app/grid/grid_Example/shortcutMenu/header-menu.vue +1 -2
- package/demos/app/grid/grid_Example/shortcutMenu/menu-permissions-composition-api.vue +1 -2
- package/demos/app/grid/grid_Example/shortcutMenu/menu-permissions.vue +1 -2
- package/demos/app/grid/slot/buttons-slot-composition-api.vue +5 -6
- package/demos/app/grid/slot/buttons-slot.vue +5 -6
- package/demos/app/grid/tiny-first-menu/copy-row-data-composition-api.vue +2 -3
- package/demos/app/grid/tiny-first-menu/copy-row-data.vue +2 -3
- package/demos/app/grid/tiny-first-menu/get-row-method-composition-api.vue +6 -7
- package/demos/app/grid/tiny-first-menu/get-row-method.vue +6 -7
- package/demos/app/grid/tiny-first-menu/insert-delete-update-composition-api.vue +3 -4
- package/demos/app/grid/tiny-first-menu/insert-delete-update.vue +3 -4
- package/demos/app/grid/toolbar/toolbar-op-config-composition-api.vue +4 -5
- package/demos/app/grid/toolbar/toolbar-op-config.vue +4 -5
- package/index.html +1 -0
- package/md.extend.config.js +6 -30
- package/package.json +23 -23
- package/playground/App.vue +37 -23
- package/src/views/components/components.vue +8 -1
- package/vite.config.js +0 -3
- package/LICENSE +0 -22
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup lang="jsx">
|
|
9
|
-
import { Alert as TinyAlert } from '@opentiny/vue'
|
|
10
|
-
import { alert } from '@opentiny/vue-modal'
|
|
9
|
+
import { Alert as TinyAlert, Modal } from '@opentiny/vue'
|
|
11
10
|
|
|
12
11
|
function close() {
|
|
13
|
-
alert('关闭了')
|
|
12
|
+
Modal.alert('关闭了')
|
|
14
13
|
}
|
|
15
14
|
</script>
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script lang="jsx">
|
|
9
|
-
import { Alert } from '@opentiny/vue'
|
|
10
|
-
import { alert } from '@opentiny/vue-modal'
|
|
9
|
+
import { Alert, Modal } from '@opentiny/vue'
|
|
11
10
|
|
|
12
11
|
export default {
|
|
13
12
|
components: {
|
|
@@ -15,7 +14,7 @@ export default {
|
|
|
15
14
|
},
|
|
16
15
|
methods: {
|
|
17
16
|
close() {
|
|
18
|
-
alert('关闭了')
|
|
17
|
+
Modal.alert('关闭了')
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
}
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref } from 'vue'
|
|
7
|
-
import { Anchor as TinyAnchor } from '@opentiny/vue'
|
|
8
|
-
import { message } from '@opentiny/vue-modal'
|
|
7
|
+
import { Anchor as TinyAnchor, Modal } from '@opentiny/vue'
|
|
9
8
|
|
|
10
9
|
const links = ref([
|
|
11
10
|
{
|
|
@@ -43,6 +42,6 @@ const links = ref([
|
|
|
43
42
|
])
|
|
44
43
|
|
|
45
44
|
function handleChange(link) {
|
|
46
|
-
message(`change${link}`)
|
|
45
|
+
Modal.message(`change${link}`)
|
|
47
46
|
}
|
|
48
47
|
</script>
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import { Anchor } from '@opentiny/vue'
|
|
7
|
-
import { message } from '@opentiny/vue-modal'
|
|
6
|
+
import { Anchor, Modal } from '@opentiny/vue'
|
|
8
7
|
|
|
9
8
|
export default {
|
|
10
9
|
components: {
|
|
@@ -50,7 +49,7 @@ export default {
|
|
|
50
49
|
},
|
|
51
50
|
methods: {
|
|
52
51
|
handleChange(link) {
|
|
53
|
-
message(`change${link}`)
|
|
52
|
+
Modal.message(`change${link}`)
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
}
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
'en-US':
|
|
29
29
|
'Data consists of indicators and dimensions. Dimension refers to data attributes, and indicator refers to quantitative measurement standards.'
|
|
30
30
|
},
|
|
31
|
-
'demoId': 'chart
|
|
31
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
'name': 'settings ',
|
|
@@ -45,42 +45,42 @@ export default {
|
|
|
45
45
|
'type': 'String',
|
|
46
46
|
'defaultValue': '该属性的默认值为 auto',
|
|
47
47
|
'desc': { 'zh-CN': '设置图表容器的宽度。', 'en-US': 'Set the width of the chart container.' },
|
|
48
|
-
'demoId': 'chart
|
|
48
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
'name': 'height',
|
|
52
52
|
'type': 'String',
|
|
53
53
|
'defaultValue': '该属性的默认值为 400px',
|
|
54
54
|
'desc': { 'zh-CN': '设置图表容器的高度。', 'en-US': 'Set the height of the chart container.' },
|
|
55
|
-
'demoId': 'chart
|
|
55
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
'name': 'events',
|
|
59
59
|
'type': 'Object',
|
|
60
60
|
'defaultValue': '',
|
|
61
61
|
'desc': { 'zh-CN': '事件绑定', 'en-US': 'Event binding' },
|
|
62
|
-
'demoId': 'chart
|
|
62
|
+
'demoId': 'chart-events#events-base'
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
'name': 'init-options',
|
|
66
66
|
'type': 'Object',
|
|
67
67
|
'defaultValue': '',
|
|
68
68
|
'desc': { 'zh-CN': 'init 附加参数', 'en-US': 'Init Additional Parameters' },
|
|
69
|
-
'demoId': 'chart
|
|
69
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
'name': 'tooltip-visible',
|
|
73
73
|
'type': 'Boolean',
|
|
74
74
|
'defaultValue': '该属性的默认值为 true',
|
|
75
75
|
'desc': { 'zh-CN': '是否显示提示框', 'en-US': 'Display dialog box' },
|
|
76
|
-
'demoId': 'chart
|
|
76
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
'name': 'legend-visible',
|
|
80
80
|
'type': 'Boolean',
|
|
81
81
|
'defaultValue': '该属性的默认值为 true',
|
|
82
82
|
'desc': { 'zh-CN': '是否显示图例', 'en-US': 'Display legend' },
|
|
83
|
-
'demoId': 'chart
|
|
83
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
'name': 'theme',
|
|
@@ -110,21 +110,21 @@ export default {
|
|
|
110
110
|
'zh-CN': '是否处理生成图表时的宽度问题',
|
|
111
111
|
'en-US': 'Do you want to process the width issue when generating charts?'
|
|
112
112
|
},
|
|
113
|
-
'demoId': 'chart
|
|
113
|
+
'demoId': 'chart-events#events-base'
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
'name': 'width-change-delay',
|
|
117
117
|
'type': 'Number',
|
|
118
118
|
'defaultValue': '该属性的默认值为 300',
|
|
119
119
|
'desc': { 'zh-CN': '容器宽度变化的延迟', 'en-US': 'Container width change delay' },
|
|
120
|
-
'demoId': 'chart
|
|
120
|
+
'demoId': 'chart-question#question-base'
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
'name': 'resizeable',
|
|
124
124
|
'type': 'Boolean',
|
|
125
125
|
'defaultValue': '该属性的默认值为 true',
|
|
126
126
|
'desc': { 'zh-CN': '是否处理窗口 resize 事件', 'en-US': 'Whether to process the window resize event' },
|
|
127
|
-
'demoId': 'chart
|
|
127
|
+
'demoId': 'chart-question#question-base'
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
'name': 'cancel-resize-check',
|
|
@@ -134,14 +134,14 @@ export default {
|
|
|
134
134
|
'zh-CN': '是否禁用 resize 时的容器检测',
|
|
135
135
|
'en-US': 'Whether to disable container detection during resize'
|
|
136
136
|
},
|
|
137
|
-
'demoId': 'chart
|
|
137
|
+
'demoId': 'chart-question#question-base'
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
'name': 'resize-delay',
|
|
141
141
|
'type': 'Number',
|
|
142
142
|
'defaultValue': '该属性的默认值为 200',
|
|
143
143
|
'desc': { 'zh-CN': '窗口 resize 事件回调的延迟', 'en-US': 'Delay of the window resize event callback' },
|
|
144
|
-
'demoId': 'chart
|
|
144
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
'name': 'change-delay',
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
151
151
|
'zh-CN': '属性修改触发图表重绘回调的延迟',
|
|
152
152
|
'en-US': 'Delay for triggering chart redrawing callback after attribute modification'
|
|
153
153
|
},
|
|
154
|
-
'demoId': 'chart
|
|
154
|
+
'demoId': 'chart-question#question-base'
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
'name': 'set-option-opts',
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup lang="jsx">
|
|
11
|
-
import { Dept as TinyDept } from '@opentiny/vue'
|
|
12
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
11
|
+
import { Dept as TinyDept, Modal } from '@opentiny/vue'
|
|
13
12
|
import { ref } from 'vue'
|
|
14
13
|
|
|
15
14
|
const value = ref('022471')
|
|
16
15
|
|
|
17
16
|
function beforeConfirm() {
|
|
18
17
|
return new Promise((resolve, reject) => {
|
|
19
|
-
confirm('确定关闭弹框?').then((res) => {
|
|
18
|
+
Modal.confirm('确定关闭弹框?').then((res) => {
|
|
20
19
|
res === 'confirm' ? resolve() : reject(new Error())
|
|
21
20
|
})
|
|
22
21
|
})
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="jsx">
|
|
11
|
-
import { Dept } from '@opentiny/vue'
|
|
12
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
11
|
+
import { Dept, Modal } from '@opentiny/vue'
|
|
13
12
|
|
|
14
13
|
export default {
|
|
15
14
|
components: {
|
|
@@ -23,7 +22,7 @@ export default {
|
|
|
23
22
|
methods: {
|
|
24
23
|
beforeConfirm() {
|
|
25
24
|
return new Promise((resolve, reject) => {
|
|
26
|
-
confirm('确定关闭弹框?').then((res) => {
|
|
25
|
+
Modal.confirm('确定关闭弹框?').then((res) => {
|
|
27
26
|
res === 'confirm' ? resolve() : reject(new Error())
|
|
28
27
|
})
|
|
29
28
|
})
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
<script setup lang="jsx">
|
|
12
12
|
import { ref } from 'vue'
|
|
13
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
14
|
-
import { message } from '@opentiny/vue-modal'
|
|
13
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
15
14
|
|
|
16
15
|
const action = ref('http://localhost:3000/api/upload')
|
|
17
16
|
const uploadRef = ref()
|
|
18
17
|
|
|
19
18
|
function cancelUpload() {
|
|
20
|
-
message('手动取消上传')
|
|
19
|
+
Modal.message('手动取消上传')
|
|
21
20
|
uploadRef.value.abort()
|
|
22
21
|
}
|
|
23
22
|
</script>
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script lang="jsx">
|
|
12
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
13
|
-
import { message } from '@opentiny/vue-modal'
|
|
12
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
14
13
|
|
|
15
14
|
export default {
|
|
16
15
|
components: {
|
|
@@ -24,7 +23,7 @@ export default {
|
|
|
24
23
|
},
|
|
25
24
|
methods: {
|
|
26
25
|
cancelUpload() {
|
|
27
|
-
message('手动取消上传')
|
|
26
|
+
Modal.message('手动取消上传')
|
|
28
27
|
this.$refs.upload.abort()
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<script setup lang="jsx">
|
|
18
18
|
import { ref } from 'vue'
|
|
19
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
20
|
-
import { message } from '@opentiny/vue-modal'
|
|
19
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
21
20
|
|
|
22
21
|
const action = ref('http://localhost:3000/api/upload')
|
|
23
22
|
const fileList = ref([
|
|
@@ -32,12 +31,12 @@ const fileList = ref([
|
|
|
32
31
|
])
|
|
33
32
|
|
|
34
33
|
function beforeRemove() {
|
|
35
|
-
message('触发删除文件前回调事件')
|
|
34
|
+
Modal.message('触发删除文件前回调事件')
|
|
36
35
|
return true
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
function beforeAvatarUpload() {
|
|
40
|
-
message('触发上传前回调事件')
|
|
39
|
+
Modal.message('触发上传前回调事件')
|
|
41
40
|
return true
|
|
42
41
|
}
|
|
43
42
|
</script>
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="jsx">
|
|
18
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
19
|
-
import { message } from '@opentiny/vue-modal'
|
|
18
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
20
19
|
|
|
21
20
|
export default {
|
|
22
21
|
components: {
|
|
@@ -40,11 +39,11 @@ export default {
|
|
|
40
39
|
},
|
|
41
40
|
methods: {
|
|
42
41
|
beforeRemove() {
|
|
43
|
-
message('触发删除文件前回调事件')
|
|
42
|
+
Modal.message('触发删除文件前回调事件')
|
|
44
43
|
return true
|
|
45
44
|
},
|
|
46
45
|
beforeAvatarUpload() {
|
|
47
|
-
message('触发上传前回调事件')
|
|
46
|
+
Modal.message('触发上传前回调事件')
|
|
48
47
|
return true
|
|
49
48
|
}
|
|
50
49
|
}
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<script setup lang="jsx">
|
|
16
16
|
import { ref } from 'vue'
|
|
17
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
18
|
-
import { message } from '@opentiny/vue-modal'
|
|
17
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
19
18
|
|
|
20
19
|
const action = ref('http://localhost:3000/api/upload')
|
|
21
20
|
const fileList = ref([
|
|
@@ -30,7 +29,7 @@ const headers = ref({
|
|
|
30
29
|
})
|
|
31
30
|
|
|
32
31
|
function beforeUpload() {
|
|
33
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
32
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
34
33
|
return true
|
|
35
34
|
}
|
|
36
35
|
</script>
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script lang="jsx">
|
|
16
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
17
|
-
import { message } from '@opentiny/vue-modal'
|
|
16
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
18
17
|
|
|
19
18
|
export default {
|
|
20
19
|
components: {
|
|
@@ -38,7 +37,7 @@ export default {
|
|
|
38
37
|
},
|
|
39
38
|
methods: {
|
|
40
39
|
beforeUpload() {
|
|
41
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
40
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
42
41
|
return true
|
|
43
42
|
}
|
|
44
43
|
}
|
|
@@ -7,15 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
<script setup lang="jsx">
|
|
9
9
|
import { ref } from 'vue'
|
|
10
|
-
import { FileUpload as TinyFileUpload } from '@opentiny/vue'
|
|
10
|
+
import { FileUpload as TinyFileUpload, Modal } from '@opentiny/vue'
|
|
11
11
|
import { iconFileupload } from '@opentiny/vue-icon'
|
|
12
|
-
import { message } from '@opentiny/vue-modal'
|
|
13
12
|
|
|
14
13
|
const action = ref('http://localhost:3000/api/upload')
|
|
15
14
|
|
|
16
15
|
const TinyIconFileupload = iconFileupload()
|
|
17
16
|
|
|
18
17
|
function dropErrorHandler(files) {
|
|
19
|
-
message(`有${files.length}个文件拖拽失败`)
|
|
18
|
+
Modal.message(`有${files.length}个文件拖拽失败`)
|
|
20
19
|
}
|
|
21
20
|
</script>
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script lang="jsx">
|
|
9
|
-
import { FileUpload } from '@opentiny/vue'
|
|
9
|
+
import { FileUpload, Modal } from '@opentiny/vue'
|
|
10
10
|
import { IconFileupload } from '@opentiny/vue-icon'
|
|
11
|
-
import { message } from '@opentiny/vue-modal'
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
components: {
|
|
@@ -22,7 +21,7 @@ export default {
|
|
|
22
21
|
},
|
|
23
22
|
methods: {
|
|
24
23
|
dropErrorHandler(files) {
|
|
25
|
-
message(`有${files.length}个文件拖拽失败`)
|
|
24
|
+
Modal.message(`有${files.length}个文件拖拽失败`)
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
<script setup lang="jsx">
|
|
10
10
|
import { ref } from 'vue'
|
|
11
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
12
|
-
import { message } from '@opentiny/vue-modal'
|
|
11
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
13
12
|
|
|
14
13
|
const requestData = ref({
|
|
15
14
|
id: 123
|
|
16
15
|
})
|
|
17
16
|
|
|
18
17
|
function beforeUpload() {
|
|
19
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
18
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
20
19
|
return true
|
|
21
20
|
}
|
|
22
21
|
</script>
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="jsx">
|
|
10
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
11
|
-
import { message } from '@opentiny/vue-modal'
|
|
10
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
components: {
|
|
@@ -24,7 +23,7 @@ export default {
|
|
|
24
23
|
},
|
|
25
24
|
methods: {
|
|
26
25
|
beforeUpload() {
|
|
27
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
26
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
28
27
|
return true
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="jsx">
|
|
8
8
|
import { ref } from 'vue'
|
|
9
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
10
|
-
import { message } from '@opentiny/vue-modal'
|
|
9
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
11
10
|
|
|
12
11
|
const action = ref('http://localhost:3000/api/upload')
|
|
13
12
|
const limit = ref(1)
|
|
14
13
|
|
|
15
14
|
function handleExceed() {
|
|
16
|
-
message(`文件个数不能超过${limit.value}个`)
|
|
15
|
+
Modal.message(`文件个数不能超过${limit.value}个`)
|
|
17
16
|
}
|
|
18
17
|
</script>
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="jsx">
|
|
8
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
9
|
-
import { message } from '@opentiny/vue-modal'
|
|
8
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
components: {
|
|
@@ -21,7 +20,7 @@ export default {
|
|
|
21
20
|
},
|
|
22
21
|
methods: {
|
|
23
22
|
handleExceed() {
|
|
24
|
-
message(`文件个数不能超过${this.limit}个`)
|
|
23
|
+
Modal.message(`文件个数不能超过${this.limit}个`)
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script setup lang="jsx">
|
|
10
10
|
import { ref } from 'vue'
|
|
11
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
12
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
11
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
13
12
|
|
|
14
13
|
const action = ref('http://localhost:3000/api/upload')
|
|
15
14
|
const fileList = ref([
|
|
@@ -21,7 +20,7 @@ const fileList = ref([
|
|
|
21
20
|
|
|
22
21
|
function beforeRemove(file) {
|
|
23
22
|
return new Promise((resolve, reject) => {
|
|
24
|
-
confirm(`确定移除 ${file.name}?`).then((res) => {
|
|
23
|
+
Modal.confirm(`确定移除 ${file.name}?`).then((res) => {
|
|
25
24
|
res === 'confirm' ? resolve() : reject(new Error())
|
|
26
25
|
})
|
|
27
26
|
})
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="jsx">
|
|
10
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
11
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
10
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
components: {
|
|
@@ -29,7 +28,7 @@ export default {
|
|
|
29
28
|
methods: {
|
|
30
29
|
beforeRemove(file) {
|
|
31
30
|
return new Promise((resolve, reject) => {
|
|
32
|
-
confirm(`确定移除 ${file.name}?`).then((res) => {
|
|
31
|
+
Modal.confirm(`确定移除 ${file.name}?`).then((res) => {
|
|
33
32
|
res === 'confirm' ? resolve() : reject(new Error())
|
|
34
33
|
})
|
|
35
34
|
})
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script setup lang="jsx">
|
|
10
10
|
import { ref } from 'vue'
|
|
11
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
12
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
11
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
13
12
|
|
|
14
13
|
const action = ref('http://localhost:3000/api/upload')
|
|
15
14
|
const fileList = ref([
|
|
@@ -21,7 +20,7 @@ const fileList = ref([
|
|
|
21
20
|
|
|
22
21
|
function beforeUpload(file) {
|
|
23
22
|
return new Promise((resolve, reject) => {
|
|
24
|
-
confirm(`确定要上传 ${file.name}?`).then((res) => {
|
|
23
|
+
Modal.confirm(`确定要上传 ${file.name}?`).then((res) => {
|
|
25
24
|
res === 'confirm' ? resolve() : reject()
|
|
26
25
|
})
|
|
27
26
|
})
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="jsx">
|
|
10
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
11
|
-
import { confirm } from '@opentiny/vue-modal'
|
|
10
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
components: {
|
|
@@ -29,7 +28,7 @@ export default {
|
|
|
29
28
|
methods: {
|
|
30
29
|
beforeUpload(file) {
|
|
31
30
|
return new Promise((resolve, reject) => {
|
|
32
|
-
confirm(`确定要上传 ${file.name}?`).then((res) => {
|
|
31
|
+
Modal.confirm(`确定要上传 ${file.name}?`).then((res) => {
|
|
33
32
|
res === 'confirm' ? resolve() : reject()
|
|
34
33
|
})
|
|
35
34
|
})
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script setup lang="jsx">
|
|
23
23
|
import { ref } from 'vue'
|
|
24
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
25
|
-
import { message } from '@opentiny/vue-modal'
|
|
24
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
26
25
|
|
|
27
26
|
const action = ref('http://localhost:3000/api/upload')
|
|
28
27
|
const fileList = ref([
|
|
@@ -37,34 +36,34 @@ const fileList = ref([
|
|
|
37
36
|
])
|
|
38
37
|
|
|
39
38
|
function handleRemove() {
|
|
40
|
-
message('触发删除文件回调事件')
|
|
39
|
+
Modal.message('触发删除文件回调事件')
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
function handlePreview(file) {
|
|
44
|
-
message(file.url)
|
|
43
|
+
Modal.message(file.url)
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
function progressEvent() {
|
|
48
|
-
message('文件上传时的回调 返回进程')
|
|
47
|
+
Modal.message('文件上传时的回调 返回进程')
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
function errorEvent() {
|
|
52
|
-
message('文件上传失败回调')
|
|
51
|
+
Modal.message('文件上传失败回调')
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
function handleExceed() {
|
|
56
|
-
message('触发文件超出个数限制回调事件')
|
|
55
|
+
Modal.message('触发文件超出个数限制回调事件')
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
function handleAvatarSuccess() {
|
|
60
|
-
message('触发上传文件成功回调事件')
|
|
59
|
+
Modal.message('触发上传文件成功回调事件')
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
function handleChange() {
|
|
64
|
-
message('触发上传文件改变回调事件')
|
|
63
|
+
Modal.message('触发上传文件改变回调事件')
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
function handleHashProgress() {
|
|
68
|
-
message('文件上传生成hash值时的回调 返回进程')
|
|
67
|
+
Modal.message('文件上传生成hash值时的回调 返回进程')
|
|
69
68
|
}
|
|
70
69
|
</script>
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script lang="jsx">
|
|
23
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
24
|
-
import { message } from '@opentiny/vue-modal'
|
|
23
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
25
24
|
|
|
26
25
|
export default {
|
|
27
26
|
components: {
|
|
@@ -45,28 +44,28 @@ export default {
|
|
|
45
44
|
},
|
|
46
45
|
methods: {
|
|
47
46
|
handleRemove() {
|
|
48
|
-
message('触发删除文件回调事件')
|
|
47
|
+
Modal.message('触发删除文件回调事件')
|
|
49
48
|
},
|
|
50
49
|
handlePreview(file) {
|
|
51
|
-
message(file.url)
|
|
50
|
+
Modal.message(file.url)
|
|
52
51
|
},
|
|
53
52
|
progressEvent() {
|
|
54
|
-
message('文件上传时的回调 返回进程')
|
|
53
|
+
Modal.message('文件上传时的回调 返回进程')
|
|
55
54
|
},
|
|
56
55
|
errorEvent() {
|
|
57
|
-
message('文件上传失败回调')
|
|
56
|
+
Modal.message('文件上传失败回调')
|
|
58
57
|
},
|
|
59
58
|
handleExceed() {
|
|
60
|
-
message('触发文件超出个数限制回调事件')
|
|
59
|
+
Modal.message('触发文件超出个数限制回调事件')
|
|
61
60
|
},
|
|
62
61
|
handleAvatarSuccess() {
|
|
63
|
-
message('触发上传文件成功回调事件')
|
|
62
|
+
Modal.message('触发上传文件成功回调事件')
|
|
64
63
|
},
|
|
65
64
|
handleChange() {
|
|
66
|
-
message('触发上传文件改变回调事件')
|
|
65
|
+
Modal.message('触发上传文件改变回调事件')
|
|
67
66
|
},
|
|
68
67
|
handleHashProgress() {
|
|
69
|
-
message('文件上传生成hash值时的回调 返回进程')
|
|
68
|
+
Modal.message('文件上传生成hash值时的回调 返回进程')
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
}
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<script setup lang="jsx">
|
|
17
17
|
import { ref } from 'vue'
|
|
18
|
-
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
|
|
19
|
-
import { message } from '@opentiny/vue-modal'
|
|
18
|
+
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'
|
|
20
19
|
|
|
21
20
|
const action = ref('http://localhost:3000/api/upload')
|
|
22
21
|
const fileList = ref([
|
|
@@ -31,7 +30,7 @@ const headers = ref({
|
|
|
31
30
|
})
|
|
32
31
|
|
|
33
32
|
function beforeUpload() {
|
|
34
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
33
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
35
34
|
|
|
36
35
|
return true
|
|
37
36
|
}
|