add iframe to demo content

This commit is contained in:
Philipp Kühn
2021-02-02 10:20:12 +01:00
parent 77db1a22e4
commit ed0dc2d5ef
8 changed files with 122 additions and 118 deletions

View File

@@ -1,11 +1,17 @@
<template>
<div class="demo-page">
<demo :name="$context.name" v-bind="props" />
<demo-content :name="$context.name" />
</div>
</template>
<script>
import DemoContent from '~/components/DemoContent'
export default {
components: {
DemoContent,
},
metaInfo() {
return {
title: this.$context.name,
@@ -17,36 +23,6 @@ export default {
],
}
},
methods: {
fromString(value) {
if (typeof value !== 'string') {
return value
}
if (value.match(/^\d*(\.\d+)?$/)) {
return Number(value)
}
if (value === 'true') {
return true
}
if (value === 'false') {
return false
}
return value
},
},
computed: {
props() {
return Object.fromEntries(Object
.entries(this.$route.query)
.map(([key, value]) => [key, this.fromString(value)]))
},
},
}
</script>