Merge branch 'develop' of ***REMOVED*** into develop

This commit is contained in:
07akioni 2019-10-22 17:10:17 +08:00
commit 26f1e5d37d
3 changed files with 40 additions and 24 deletions

View File

@ -1,14 +1,17 @@
# Async
```html
<n-button @click="handleClick">
Success
</n-button>
```
```css
.n-button {
margin: 0 12px 8px 0;
}
```
```js
export default {
methods: {
@ -17,9 +20,10 @@ export default {
title: "Success",
content:
"Premium designed icons for use in web, iOS, Android, and desktop apps. Support for SVG and web font. Completely open source, MIT licensed and built by the Ionic Framework team.",
onPositiveClick: (hide) => {
onPositiveClick: hide => {
confirmInstance.loading = true;
this.$NMessage.success("count down 1 second");
window.setTimeout(hide, 1000)
window.setTimeout(hide, 1000);
}
});
}

View File

@ -47,12 +47,13 @@
:theme="theme"
round
:disabled="loading === true"
:loading="loading"
size="small"
type="primary"
auto-text-color
@click="handlePositiveClick"
>
{{ loading === true ? "Loading" : positiveText }}
{{positiveText}}
</n-button>
</div>
</div>

View File

@ -1,4 +1,3 @@
import Confirm from './confirm.vue'
const instances = new Set()
@ -23,30 +22,42 @@ export default {
},
confirm (options) {
const instance = this.createInstance()
setDataOnConfirmInstance({
setDataOnConfirmInstance(
{
type: 'confirm',
active: true,
theme: this.theme,
...options
}, instance)
},
instance
)
return instance
},
error (options) {
const instance = this.createInstance()
setDataOnConfirmInstance({
setDataOnConfirmInstance(
{
type: 'error',
active: true,
theme: this.theme,
...options
}, instance)
},
instance
)
return instance
},
success (options) {
const instance = this.createInstance()
setDataOnConfirmInstance({
setDataOnConfirmInstance(
{
type: 'success',
active: true,
theme: this.theme,
...options
}, instance)
},
instance
)
return instance
},
destroyAll () {
instances.forEach(instance => {