finish author system
This commit is contained in:
parent
db8669d30d
commit
fe6e01acdf
38 changed files with 614 additions and 73 deletions
37
site/plugins/send-button/src/components/SendButtonField.vue
Executable file
37
site/plugins/send-button/src/components/SendButtonField.vue
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
<template>
|
||||
<k-button @click="send($event)" variant="filled" icon="plane">{{
|
||||
text
|
||||
}}</k-button>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const { pageUri } = defineProps({
|
||||
pageUri: String,
|
||||
});
|
||||
|
||||
const text = ref("Envoyer");
|
||||
|
||||
const headers = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
pageUri,
|
||||
}),
|
||||
};
|
||||
|
||||
function send(event) {
|
||||
event.preventDefault();
|
||||
fetch("/send-newsletter.json", headers)
|
||||
.then((res) => res.json())
|
||||
.then((json) => console.log(json));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@media screen and (min-width: 533px) {
|
||||
button {
|
||||
margin-top: 2.15rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
7
site/plugins/send-button/src/index.js
Executable file
7
site/plugins/send-button/src/index.js
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
import SendButtonField from "./components/SendButtonField.vue";
|
||||
|
||||
window.panel.plugin("adrienpayet/send-button", {
|
||||
fields: {
|
||||
"send-button": SendButtonField,
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue