forked from rasteiner/k3-pagesdisplay-section
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (33 loc) · 818 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
panel.plugin("rasteiner/k3-pagesdisplay-section", {
use: [(Vue) => {
const o = Vue.component("k-pages-section").options;
Vue.component("k-pagesdisplay-section", {
extends: o,
props: {
controls: {
type: [Boolean, String],
default: true,
},
},
computed: {
items() {
let data = o.computed.items.call(this);
if (this.controls === false) {
for (const item of data) {
delete item.flag
delete item.options
}
return data;
}
if (this.controls === "flag") {
for (const item of data) {
delete item.options
}
return data;
}
return data;
},
},
});
}],
});