diff --git a/src/notify/Notify.tsx b/src/notify/Notify.tsx index 8ccfbcc4d..09370b116 100644 --- a/src/notify/Notify.tsx +++ b/src/notify/Notify.tsx @@ -1,6 +1,5 @@ // Utils import { createNamespace } from '../utils'; -import { WHITE } from '../utils/constant'; import { inherit } from '../utils/functional'; // Mixins @@ -54,6 +53,7 @@ function Notify( Notify.props = { ...popupMixinProps, + color: String, background: String, className: null as any, message: [Number, String], @@ -62,10 +62,6 @@ Notify.props = { type: String, default: 'danger', }, - color: { - type: String, - default: WHITE, - }, duration: { type: Number, default: 3000, diff --git a/src/notify/index.less b/src/notify/index.less index 6bf356cfd..e0c2a040a 100644 --- a/src/notify/index.less +++ b/src/notify/index.less @@ -3,6 +3,7 @@ .van-notify { box-sizing: border-box; padding: @notify-padding; + color: @notify-text-color; font-size: @notify-font-size; line-height: @notify-line-height; diff --git a/src/notify/index.ts b/src/notify/index.ts index 8e33dc360..8dbb9f1aa 100644 --- a/src/notify/index.ts +++ b/src/notify/index.ts @@ -1,6 +1,5 @@ import Vue from 'vue'; import VanNotify from './Notify'; -import { WHITE } from '../utils/constant'; import { isObject, isServer } from '../utils'; import { mount } from '../utils/functional'; import { NotifyOptions } from 'types/notify'; @@ -60,7 +59,7 @@ function defaultOptions(): NotifyOptions { type: 'danger', value: true, message: '', - color: WHITE, + color: undefined, background: undefined, duration: 3000, className: '', diff --git a/src/notify/test/__snapshots__/index.spec.js.snap b/src/notify/test/__snapshots__/index.spec.js.snap index c3e4f0f92..68a85cc1c 100644 --- a/src/notify/test/__snapshots__/index.spec.js.snap +++ b/src/notify/test/__snapshots__/index.spec.js.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`create a notify 1`] = `
test
`; +exports[`create a notify 1`] = `
test
`; -exports[`notify disappear 1`] = `
test
`; +exports[`notify disappear 1`] = `
test
`; -exports[`notify disappear 2`] = ``; +exports[`notify disappear 2`] = ``; -exports[`notify disappear 3`] = `
text2
`; +exports[`notify disappear 3`] = `
text2
`; -exports[`notify disappear 4`] = ``; +exports[`notify disappear 4`] = ``; -exports[`type prop 1`] = `
test
`; +exports[`type prop 1`] = `
test
`; diff --git a/src/style/var.less b/src/style/var.less index 65b3652fc..11e8eeca6 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -445,6 +445,7 @@ @notice-bar-icon-min-width: 22px; // Notify +@notify-text-color: @white; @notify-padding: @padding-xs @padding-md; @notify-font-size: @font-size-md; @notify-line-height: 20px;