From 11a672f9e3ff053f40a73f17e81db27578a20432 Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 19 Jan 2019 09:04:37 +0800 Subject: [PATCH] [improvement] Notify: jsx (#2557) --- packages/notify/Notify.js | 43 ++++++++++++++++++++++++++++++++ packages/notify/Notify.vue | 51 -------------------------------------- 2 files changed, 43 insertions(+), 51 deletions(-) create mode 100644 packages/notify/Notify.js delete mode 100644 packages/notify/Notify.vue diff --git a/packages/notify/Notify.js b/packages/notify/Notify.js new file mode 100644 index 000000000..b7e1b0a25 --- /dev/null +++ b/packages/notify/Notify.js @@ -0,0 +1,43 @@ +import { use } from '../utils'; +import PopupMixin from '../mixins/popup'; +import { RED, WHITE } from '../utils/color'; + +const [sfc, bem] = use('notify'); + +export default sfc({ + mixins: [PopupMixin], + + props: { + message: [String, Number], + color: { + type: String, + value: WHITE + }, + background: { + type: String, + value: RED + }, + duration: { + type: Number, + value: 3000 + }, + lockScroll: { + type: Boolean, + default: false + } + }, + + render(h) { + const style = { + color: this.color, + background: this.background + }; + return ( + +
+ {this.message} +
+
+ ); + } +}); diff --git a/packages/notify/Notify.vue b/packages/notify/Notify.vue deleted file mode 100644 index fcffb6336..000000000 --- a/packages/notify/Notify.vue +++ /dev/null @@ -1,51 +0,0 @@ - - -