<template>
  <div>
    <transition name="fade">
      <div
        :class="b(['tips',
          {'success': type==='success'},
          {'info': type==='info'},
          {'warning': type==='warning'},
          {'error': type==='error'}
        ])" v-if="visible">
        <span v-text="content"></span>
      </div>
    </transition>
  </div>
</template>
<script>
import create from '../utils/create'
export default create({
  name: 'notify',

  props: {
    content: {
      type: String
    },
    visible: {
      type: Boolean
    },
    type: {
      type: String,
      default: 'error'
    }
  },
  methods: {
    close () {
      this.visible = false
    }
  }
})
</script>
