@opentiny/vue-docs 2.0.5 → 2.0.7
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/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/package.json +4 -4
- package/playground/App.vue +12 -0
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="jsx">
|
|
17
|
-
import { FileUpload, Button } from '@opentiny/vue'
|
|
18
|
-
import { message } from '@opentiny/vue-modal'
|
|
17
|
+
import { FileUpload, Button, Modal } from '@opentiny/vue'
|
|
19
18
|
|
|
20
19
|
export default {
|
|
21
20
|
components: {
|
|
@@ -39,7 +38,7 @@ export default {
|
|
|
39
38
|
},
|
|
40
39
|
methods: {
|
|
41
40
|
beforeUpload() {
|
|
42
|
-
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
41
|
+
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
|
|
43
42
|
|
|
44
43
|
return true
|
|
45
44
|
}
|
|
@@ -111,7 +111,6 @@ import {
|
|
|
111
111
|
Option as TinyOption,
|
|
112
112
|
Modal
|
|
113
113
|
} from '@opentiny/vue'
|
|
114
|
-
import { alert } from '@opentiny/vue-modal'
|
|
115
114
|
|
|
116
115
|
const displayOnly = ref(true)
|
|
117
116
|
const top = ref(false)
|
|
@@ -420,7 +419,7 @@ onMounted(() => {
|
|
|
420
419
|
})
|
|
421
420
|
|
|
422
421
|
function submitClick() {
|
|
423
|
-
alert('提交')
|
|
422
|
+
Modal.alert('提交')
|
|
424
423
|
}
|
|
425
424
|
|
|
426
425
|
function querySearch(queryString, cb) {
|
|
@@ -110,7 +110,6 @@ import {
|
|
|
110
110
|
Option,
|
|
111
111
|
Modal
|
|
112
112
|
} from '@opentiny/vue'
|
|
113
|
-
import { alert } from '@opentiny/vue-modal'
|
|
114
113
|
|
|
115
114
|
export default {
|
|
116
115
|
components: {
|
|
@@ -439,7 +438,7 @@ export default {
|
|
|
439
438
|
},
|
|
440
439
|
methods: {
|
|
441
440
|
submitClick() {
|
|
442
|
-
alert('提交')
|
|
441
|
+
Modal.alert('提交')
|
|
443
442
|
},
|
|
444
443
|
querySearch(queryString, cb) {
|
|
445
444
|
let restaurants = this.restaurants
|