Add disable close option to base overlay component

This commit is contained in:
kPherox 2019-04-27 05:15:24 +09:00
parent d3b5d05762
commit a19b3c899f
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@
<BaseOverlay <BaseOverlay
v-show="status !== 'welcome'" v-show="status !== 'welcome'"
@close="status = 'welcome'" @close="status = 'welcome'"
:disableClose="status === 'select_timeline'"
:title="status === 'login' :title="status === 'login'
? loginButton ? loginButton
: status === 'public_timeline' : status === 'public_timeline'

View File

@ -1,7 +1,7 @@
<template> <template>
<transition name="fade"> <transition name="fade">
<div class="overlay"> <div class="overlay">
<button type="button" class="close-button" @click="closeOverlay">X</button> <button type="button" class="close-button" @click="closeOverlay" v-show="!disableClose">X</button>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<div class="overlay-inner"> <div class="overlay-inner">
<slot/> <slot/>
@ -19,6 +19,8 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
export default class BaseOverlay extends Vue { export default class BaseOverlay extends Vue {
@Prop() @Prop()
public title?: string public title?: string
@Prop()
public disableClose?: boolean
public closeOverlay() { public closeOverlay() {
this.$emit('close') this.$emit('close')