<template> <Upload action="//jsonplaceholder.typicode.com/posts/"> <Button type="ghost" icon="ios-cloud-upload-outline">Upload files</Button> </Upload> </template> <script> export default { } </script>
<template> <Button @click="confirm">Normal</Button> <Button @click="custom">Custom button text</Button> <Button @click="async">Asynchronous closing</Button> </template> <script> export default { methods: { confirm () { this.$Modal.confirm({ title: 'Title', content: '<p>Content of dialog</p><p>Content of dialog</p>', onOk: () => { this.$Message.info('Clicked ok'); }, onCancel: () => { this.$Message.info('Clicked cancel'); } }); }, custom () { this.$Modal.confirm({ title: 'Title', content: '<p>Content of dialog</p><p>Content of dialog</p>', okText: 'OK', cancelText: 'Cancel' }); }, async () { this.$Modal.confirm({ title: 'Title', content: '<p>The dialog box will be closed after 2 seconds</p>', loading: true, onOk: () => { setTimeout(() => { this.$Modal.remove(); this.$Message.info('Asynchronously close the dialog box'); }, 2000); } }); } } } </script>