瀏覽代碼

MessageBox: support empty title

Leopoldthecoder 8 年之前
父節點
當前提交
534f9923b7
共有 4 個文件被更改,包括 7 次插入34 次删除
  1. 0 27
      examples/play/component.vue
  2. 0 6
      examples/play/index.vue
  3. 6 0
      packages/message-box/src/main.js
  4. 1 1
      packages/message-box/src/main.vue

+ 0 - 27
examples/play/component.vue

@@ -1,27 +0,0 @@
-<template>
-  <div>
-    <el-button @click="value = '#fff'">Change Value</el-button>
-    <div>Value: {{ value }}</div>
-    <el-color-picker v-model="value"></el-color-picker>
-
-    <div>Value2: {{ value2 }}</div>
-    <el-color-picker v-model="value2" show-alpha></el-color-picker>
-  </div>
-</template>
-
-<style scoped>
-</style>
-
-<script type="text/ecmascript-6">
-  export default {
-    methods: {
-    },
-
-    data() {
-      return {
-        value: '#bfcbd9',
-        value2: null
-      };
-    }
-  };
-</script>

+ 0 - 6
examples/play/index.vue

@@ -1,14 +1,8 @@
 <template>
   <div style="margin: 20px;">
-    <!-- Write your component in component.vue -->
-    <play-component></play-component>
   </div>
 </template>
 <script>
-  import PlayComponent from './component.vue';
   export default {
-    components: {
-      PlayComponent
-    }
   };
 </script>

+ 6 - 0
packages/message-box/src/main.js

@@ -158,6 +158,8 @@ MessageBox.alert = (message, title, options) => {
   if (typeof title === 'object') {
     options = title;
     title = '';
+  } else if (title === undefined) {
+    title = '';
   }
   return MessageBox(merge({
     title: title,
@@ -172,6 +174,8 @@ MessageBox.confirm = (message, title, options) => {
   if (typeof title === 'object') {
     options = title;
     title = '';
+  } else if (title === undefined) {
+    title = '';
   }
   return MessageBox(merge({
     title: title,
@@ -185,6 +189,8 @@ MessageBox.prompt = (message, title, options) => {
   if (typeof title === 'object') {
     options = title;
     title = '';
+  } else if (title === undefined) {
+    title = '';
   }
   return MessageBox(merge({
     title: title,

+ 1 - 1
packages/message-box/src/main.vue

@@ -3,7 +3,7 @@
     <div class="el-message-box__wrapper" tabindex="-1" v-show="visible" @click.self="handleWrapperClick">
       <div class="el-message-box" :class="customClass">
         <div class="el-message-box__header" v-if="title !== undefined">
-          <div class="el-message-box__title">{{ title || t('el.messagebox.title') }}</div>
+          <div class="el-message-box__title">{{ title }}</div>
           <button type="button" class="el-message-box__headerbtn" aria-label="Close" 
                   v-if="showClose" @click="handleAction('cancel')">
             <i class="el-message-box__close el-icon-close"></i>