element-plus / vue-cli-plugin-element-plus

Element Plus plugin for @vue/cli 4.5
MIT License
126 stars 16 forks source link

ElNotification icon color presents always red as error type, no matter what type it is set #25

Open egao5566 opened 3 years ago

egao5566 commented 3 years ago

i tried

this.$notify.success({
            title: "transaction successed",
            message: 'success',
            duration: 3000,
})

and

this.$notify({
            title: "transaction successed",
            message: 'success',
            type: 'success',  //or 'info' or 'warning'
            duration: 3000,
});

at last always get a right icon with color red (type error)

YunYouJun commented 3 years ago

Did you upgrade it?

Try import { ElNotification } from 'element-plus'.

ElNotification({
    title: 'Success',
    message: 'This is a success message',
    type: 'success',
  })

More info see https://element-plus.org/en-US/component/notification.html#notification.

egao5566 commented 3 years ago

Did you upgrade it?

Try import { ElNotification } from 'element-plus'.

ElNotification({
    title: 'Success',
    message: 'This is a success message',
    type: 'success',
  })

More info see https://element-plus.org/en-US/component/notification.html#notification.

sure. version 0.013 which noted latest version in vue-cli. and import action is done in main.js

import { ElNotification } from 'element-plus'
...
app.config.globalProperties.$notify = ElNotification