await response.json()
<template>
<div class="doughnut">
<canvas ref="chart"></canvas>
</div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import {
Chart,
DoughnutController,
ArcElement,
} from 'https://cdn.skypack.dev/chart.js@4.2.1';
Chart.register(
DoughnutController,
ArcElement,
);
const chart = ref(null);
const data = {
datasets: [
{
data: [40, 22, 8, 30],
backgroundColor: [
"#F04B92",
"#54B2FD",
"#FFC24B",
"#49EBCE",
],
display: true,
offset: 2,
spacing: -30,
borderColor: "#fff",
borderWidth: 2,
borderRadius: [
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 16, innerStart: 16, innerEnd: 16}
],
cutout: "58%",
}
],
labels: false
};
const config = {
type: 'doughnut',
data,
options: {
rotation: 270,
circumference: 180,
maintainAspectRatio: false,
responsive: true,
animation: {
animateRotate: true
}
},
}
onMounted(() => {
const myChart = new Chart(
chart.value,
config
);
const ctx = myChart.canvas.getContext("2d");
ctx.scale(0.8, 0.8);
});
</script>
document.body.style.overflow = 'hidden';
// scroll
document.body.style.overflow = 'scroll';
const wheelCallback = (e)=> e.preventDefault();
document.getElementById('slider').addEventListener('wheel', wheelCallback);
// scroll
document.getElementById('slider').removeEventListener('wheel', wheelCallback);
function Test() {
this.abc = 123;
this.obj = {
try: function() { console.log(this.abc) }
}
return this
}
const t = new Test();
const obj = t.obj.try;
obj.apply(t)
const textParagraph = document.createElement('p');
textParagraph.innerText = response.message;
const historyArr = new Proxy([], {
get(target, property) {
console.log(property)
return target[property]
},
set(target, property, value) {
if (target.length > 9) {
target.pop();
}
target.unshift(value);
return true;
}
});