fix react renderer
This commit is contained in:
committed by
Hans Pagel
parent
7bf5ee3827
commit
14bcf80659
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="demo-page">
|
||||
<demo-content :name="$context.name" />
|
||||
<demo-content :name="$context.name" v-bind="props" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -30,6 +30,40 @@ 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
|
||||
}
|
||||
|
||||
if (value === 'null') {
|
||||
return null
|
||||
}
|
||||
|
||||
return value
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
props() {
|
||||
return Object.fromEntries(Object
|
||||
.entries(this.$route.query)
|
||||
.map(([key, value]) => [key, this.fromString(value)]))
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.resizeObserver = new window.ResizeObserver(items => {
|
||||
if (window.parentIFrame) {
|
||||
|
||||
Reference in New Issue
Block a user