Skip to content
Snippets Groups Projects
EncycloPage.vue 1.51 KiB
Newer Older
<template>
moon's avatar
moon committed
  <div
    id="page-content-wrapper"
    class="main"
  >
    <fetch-wiki-main-page>
      <template slot-scope="{response, loading}">
moon's avatar
moon committed
        <slot
          :response="response"
          :loading="loading"
        >
          <div v-if="loading || response === null">
            <base-spinner />
          </div>
          <div v-else>
moon's avatar
moon committed
            <!--            <h1>{{response.title}}</h1>-->
            <vue-markdown>
moon's avatar
moon committed
              {{ response.content.replaceAll('](/', `](${url}`) }}
            </vue-markdown>
          </div>
        </slot>
      </template>
    </fetch-wiki-main-page>
  </div>
</template>

<script>
moon's avatar
moon committed
import FetchWikiMainPage from '@/components/DDCODE/fetchWikiMainPage';
import VueMarkdown from 'vue-markdown'
import BaseSpinner from './UI/BaseSpinner.vue';
const _ = require('lodash')

export default {
  name: 'EncycloPage',
  components: {
    FetchWikiMainPage, VueMarkdown,
    BaseSpinner
  },
  props: {
    msg: String
  },
  data() {
    return {
      url: document.location.protocol + '//wiki.ddcode.org/',
      isDev: process.env.NODE_ENV === 'development'
    }
  },
  computed: {
  },
  methods: {
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
@import url('~@/assets/bootstrap.css');

.main {
  margin: 1.5rem;
}

h3 {
  margin: 40px 0 0;
}

a {
  color: #42b983;
}

ul.a {
  list-style-type: disc;
  list-style-position: inside;
}

input[type="radio"] {
  margin: 2px;
}

.radio-label {
  margin-left: 0px;
  margin-right: 5px;
}
</style>