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

preview-component.js 808B

123456789101112131415161718192021222324252627282930
  1. export const ComponentExample = {
  2. props: ['component'],
  3. template: `
  4. <div class="page pv-component-example" :class="{'page--material__background': isAndroid()}">
  5. <!-- ontouchstart is a hack to enable :active CSS selector in iOS browsers. -->
  6. <div style="width: 100%;" v-html="component.markup" ontouchstart=""></div>
  7. </div>
  8. `,
  9. methods: {
  10. isAndroid() {
  11. return this.component.name.match(/Material/);
  12. }
  13. }
  14. };
  15. export const PreviewComponent = {
  16. props: ['component'],
  17. template: `
  18. <div class="pv-component-preview">
  19. <a class="pv-title-label" :href="'/components/' + component.id">{{component.name}}</a>
  20. <component-example :component="component" />
  21. </div>
  22. `,
  23. components: {
  24. 'component-example': ComponentExample
  25. }
  26. };