docs(message): remove api call of $NMessage

This commit is contained in:
07akioni 2020-12-07 23:55:54 +08:00
parent 7a5e3f9bcc
commit b313057b80
8 changed files with 19 additions and 13 deletions

View File

@ -15,12 +15,13 @@ Get current theme and namespace.
```
```js
export default {
inject: ['message'],
methods: {
handleThemeChange (value, oldValue) {
this.$NMessage.info('Theme Change: `' + value + '` theme')
this.message.info('Theme Change: `' + value + '` theme')
},
handleNamespaceChange (value, oldValue) {
this.$NMessage.info('Namespace Change: `' + value + '` namespace')
this.message.info('Namespace Change: `' + value + '` namespace')
}
}
}

View File

@ -58,6 +58,7 @@ const data = [
]
export default {
inject: ['message'],
data () {
return {
data,
@ -67,7 +68,7 @@ export default {
},
methods: {
sendMail(rowData) {
this.$NMessage.info('Send mail to ' + rowData.name)
this.message.info('Send mail to ' + rowData.name)
}
}
}

View File

@ -68,6 +68,7 @@ const data = Array.apply(null, { length: 46 }).map((_, index) => ({
export default {
inject: ['message'],
data() {
return {
data,
@ -81,7 +82,7 @@ export default {
},
methods: {
sendMail(rowData) {
this.$NMessage.info('send mail to ' + rowData.name)
this.message.info('send mail to ' + rowData.name)
}
}
}

View File

@ -37,6 +37,7 @@ const data = Array.apply(null, { length: 46 }).map((_, index) => ({
export default {
inject: ['message'],
data() {
return {
data,
@ -48,7 +49,7 @@ export default {
},
methods: {
sendMail (rowData) {
this.$NMessage.info('send mail to ' + rowData.name)
this.message.info('send mail to ' + rowData.name)
}
}
}

View File

@ -44,7 +44,8 @@ const data = Array.apply(null, { length: 46 }).map((_, index) => ({
}))
export default {
data() {
inject: ['message'],
data () {
return {
data,
columns,
@ -56,7 +57,7 @@ export default {
},
methods: {
sendMail(rowData) {
this.$NMessage.info('send mail to ' + rowData.name)
this.message.info('send mail to ' + rowData.name)
},
handleCheck (rowKeys) {
this.checkedRowKeys = rowKeys

View File

@ -71,10 +71,10 @@ export default {
e.preventDefault()
this.$refs.form.validate(errors => {
if (!errors) {
this.$NMessage.success('Valid')
this.message.success('Valid')
} else {
console.log(errors)
this.$NMessage.error('Invalid')
this.message.error('Invalid')
}
})
}

View File

@ -19,6 +19,7 @@ Why change event is an example? Because at first there isn't much to write.
```
```js
export default {
inject: ['message'],
data () {
return {
selectedValue: 'song1',
@ -76,8 +77,8 @@ export default {
}
},
methods: {
handleChange (item) {
this.$NMessage.info('value: ' + JSON.stringify(item))
handleChange (value) {
this.message.info('value: ' + JSON.stringify(value))
}
}
}

View File

@ -77,8 +77,8 @@ export default {
}
},
methods: {
handleChange (item) {
this.message.info('value: ' + JSON.stringify(item))
handleChange (value) {
this.message.info('value: ' + JSON.stringify(value))
}
}
}