-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathPluginAttributes.njs
More file actions
54 lines (42 loc) · 1.19 KB
/
PluginAttributes.njs
File metadata and controls
54 lines (42 loc) · 1.19 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import Nullstack from 'nullstack'
class PluginAttributes extends Nullstack {
title = 'Nullstack';
showTitle = true
pluginInServer = false
pluginInClient = false
accessInLoad = false
accessInTransform = false
prepare({ pluginData }) {
this.pluginInServer = pluginData.changedServer
}
hydrate({ pluginData }) {
this.pluginInClient = pluginData.changedClient
this.accessInLoad = pluginData.accessInLoad
this.accessInTransform = pluginData.accessInTransform
}
boldTitle() {
return `<b>${this.title}</b>`
}
renderVueablePlugin() {
return (
<div data-hydrated={this.hydrated}>
<h1 v-if={this.showTitle} v-html={this.boldTitle()} data-vue />
<button data-btn={(!this.showTitle).toString()} onclick={{ showTitle: !this.showTitle }}>
Toggle title
</button>
<p data-changed-server={this.pluginInServer} />
<p data-changed-client={this.pluginInClient} />
<p data-access-load={this.accessInLoad} />
<p data-access-transform={this.accessInTransform} />
</div>
)
}
render() {
return (
<div>
<VueablePlugin />
</div>
)
}
}
export default PluginAttributes