<template>
    <div>
      <functionBar class="F_bar" @isSaved="isSaved" />
      <b-container fluid>
      <b-row class="no-padding" style="padding-top: 25px;">
            <b-col cols="12" style="margin-top: 80px">
                  <file-submit-content style="margin-right:80px" ref="fileSubmitContent" />
            </b-col>
      </b-row>
      </b-container>
    </div>
</template>

<script>
import functionBar from '@/views/FileManagement/FileEdit/functionBar.vue'
import fileSubmitContent from '@/views/FileManagement/FileEdit/fileSubmitContent.vue'

export default {
  data () {
    return {
      isCreate: ''
    }
  },
  beforeRouteLeave (to, from, next) {
    if (this.isCreate !== true) {
      const answer = window.confirm('尚未儲存，確定離開當前畫面?')
      if (answer) {
        next()
      } else {
        next(false)
      }
    } else {
      next()
    }
  },
  methods: {
    isSaved (value) {
      console.log(value)
      this.isCreate = true
    }
  },
  components: {
    fileSubmitContent,
    functionBar
  }
}
</script>

<style lang="scss" scoped>
//發文內容頂部抬頭間距

.main-content .container-sm, .main-content .container-md, .main-content .container-lg, .main-content .container-xl{
  padding-left: 15px !important;
  padding-right: 39px !important;
}
.no-padding [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;

}
</style>
