fin du tuto, les vrais galere commence
This commit is contained in:
parent
d365abfdb9
commit
7d3d20d006
5 changed files with 66 additions and 8 deletions
|
|
@ -8,6 +8,8 @@ tabs:
|
|||
presentationSection:
|
||||
type: fields
|
||||
fields:
|
||||
demo:
|
||||
type: demo
|
||||
presentation:
|
||||
extends: fields/body
|
||||
label: Présentation
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
};
|
||||
var _sfc_staticRenderFns = [function() {
|
||||
var _vm = this, _c = _vm._self._c;
|
||||
return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Your custom section")])])]);
|
||||
return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Test")])])]);
|
||||
}];
|
||||
_sfc_render._withStripped = true;
|
||||
var __component__ = /* @__PURE__ */ normalizeComponent(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,20 @@
|
|||
<?php
|
||||
|
||||
Kirby::plugin('getkirby/pluginkit', [
|
||||
'sections' => [
|
||||
'demo' => []
|
||||
'fields' => [
|
||||
'demo' => [
|
||||
'props' => [
|
||||
'value' => function ($value = null) {
|
||||
$margins = Yaml::decode($value);
|
||||
return [
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
...$margins
|
||||
];
|
||||
}
|
||||
]
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,57 @@
|
|||
<template>
|
||||
<section class="k-demo-section">
|
||||
<k-field class="">
|
||||
<header class="k-section-header">
|
||||
<h2 class="k-headline">Your custom section</h2>
|
||||
<h2 class="k-headline">Test</h2>
|
||||
</header>
|
||||
</section>
|
||||
<main>
|
||||
<k-input
|
||||
:value="value.top"
|
||||
type="text"
|
||||
before="Top"
|
||||
@input="onInput('top', $event)"
|
||||
/>
|
||||
<k-input
|
||||
:value="value.right"
|
||||
type="text"
|
||||
before="Right"
|
||||
@input="onInput('right', $event)"
|
||||
/>
|
||||
<k-input
|
||||
:value="value.bottom"
|
||||
type="text"
|
||||
before="Bottom"
|
||||
@input="onInput('bottom', $event)"
|
||||
/>
|
||||
<k-input
|
||||
:value="value.left"
|
||||
type="text"
|
||||
before="Left"
|
||||
@input="onInput('left', $event)"
|
||||
/>
|
||||
<k-button class="k-button">
|
||||
Générer le fichier texte
|
||||
</k-button>
|
||||
|
||||
</main>
|
||||
</k-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// Put your section logic here
|
||||
extends: "k-field",
|
||||
props: {
|
||||
value: Object
|
||||
},
|
||||
methods: {
|
||||
onInput(margin, value){
|
||||
const newValue = {
|
||||
...this.value,
|
||||
[margin]: value
|
||||
}
|
||||
|
||||
this.$emit("input", newValue)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import DemoSection from "./components/DemoSection.vue";
|
||||
|
||||
window.panel.plugin("getkirby/pluginkit", {
|
||||
sections: {
|
||||
fields: {
|
||||
demo: DemoSection
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue