Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

component-page.js 827B

1234567891011121314151617181920212223242526272829303132
  1. import {ComponentExample} from './preview-component.js';
  2. import {ThemeSelect} from './theme-select';
  3. export const ComponentPage = {
  4. props: ['components', 'id', 'query'],
  5. components: {
  6. 'component-example': ComponentExample,
  7. 'theme-select': ThemeSelect
  8. },
  9. computed: {
  10. component() {
  11. return this.components.filter(component => component.id === this.id)[0];
  12. }
  13. },
  14. template: `
  15. <div class="pv-content" v-if="component">
  16. <div>
  17. <h2 class="pv-content__header">{{component.name}}</h2>
  18. <theme-select :theme="query.theme" :query="query" />
  19. <h3 class="pv-title-label">Example</h3>
  20. <component-example :component="component" />
  21. <h3 class="pv-title-label">HTML</h3>
  22. <pre class="pv-markup">{{component.markup}}</pre>
  23. </div>
  24. </div>
  25. `
  26. };