updating page title prop

This commit is contained in:
Martin McKeaveney 2020-06-03 16:44:01 +01:00
parent 53dc3780fa
commit 02fac0774e
3 changed files with 9 additions and 11 deletions

View File

@ -71,18 +71,15 @@
}
}
$: console.log("COMP INSTA NEW", componentInstanceNew)
const onStyleChanged = store.setComponentStyle
function onPropChanged(key, value) {
if($store.currentFrontEndType === "page") {
if($store.currentFrontEndType === "page" || ($store.currentFrontEndType === "screen" && $store.currentView !== "component")) {
store.editPageOrScreen(key, value)
}else if($store.currentFrontEndType === "screen" && $store.currentView !== "component") {
store.editPageOrScreen(key, value)
}else {
store.setComponentProp(key, value)
return;
}
store.setComponentProp(key, value)
}
function walkProps(component, action) {

View File

@ -9,12 +9,13 @@
export let componentInstance = {}
export let onChange = () => {}
let pageScreenProps = ["name", "favicon", "description", "route"]
let pageScreenProps = ["title", "favicon", "description", "route"]
const propExistsOnComponentDef = prop => pageScreenProps.includes(prop) || prop in componentDefinition.props
function handleChange(key, data) {
data.target ? onChange(key, data.target.value) : onChange(key, data)
const value = data.target ? data.target.value : data
onChange(key, value)
}
</script>

View File

@ -11,7 +11,7 @@ export const screen = [
]
export const page = [
{ label: "Name", key: "name", control: Input },
{ label: "Title", key: "title", control: Input },
{ label: "Favicon", key: "favicon", control: Input },
]