<template>
  <div v-if="active">
    <slot />
  </div>
  <div v-else class="card">
    <div class="card-body">
      <div>
        <slot name="lock">
          <p v-if="name">Click to load external content from {{ name }}.</p>
          <p v-else>Click to load external content.</p>
        </slot>
      </div>
      <button class="btn btn-primary" @click="active = true">load content</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "ExternalContentWrapper",
  props: {
    name: String,
  },
  data: () => ({
    active: false,
  }),
}
</script>

<style scoped>

</style>