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
v-show="status !== 'welcome'"
@close="status = 'welcome'"
:disableClose="status === 'select_timeline'"
:title="status === 'login'
? loginButton
: status === 'public_timeline'

View File

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