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:
|
presentationSection:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
|
demo:
|
||||||
|
type: demo
|
||||||
presentation:
|
presentation:
|
||||||
extends: fields/body
|
extends: fields/body
|
||||||
label: Présentation
|
label: Présentation
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
};
|
};
|
||||||
var _sfc_staticRenderFns = [function() {
|
var _sfc_staticRenderFns = [function() {
|
||||||
var _vm = this, _c = _vm._self._c;
|
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;
|
_sfc_render._withStripped = true;
|
||||||
var __component__ = /* @__PURE__ */ normalizeComponent(
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
Kirby::plugin('getkirby/pluginkit', [
|
Kirby::plugin('getkirby/pluginkit', [
|
||||||
'sections' => [
|
'fields' => [
|
||||||
'demo' => []
|
'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>
|
<template>
|
||||||
<section class="k-demo-section">
|
<k-field class="">
|
||||||
<header class="k-section-header">
|
<header class="k-section-header">
|
||||||
<h2 class="k-headline">Your custom section</h2>
|
<h2 class="k-headline">Test</h2>
|
||||||
</header>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import DemoSection from "./components/DemoSection.vue";
|
import DemoSection from "./components/DemoSection.vue";
|
||||||
|
|
||||||
window.panel.plugin("getkirby/pluginkit", {
|
window.panel.plugin("getkirby/pluginkit", {
|
||||||
sections: {
|
fields: {
|
||||||
demo: DemoSection
|
demo: DemoSection
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue