|
55 | 55 | };
|
56 | 56 | },
|
57 | 57 | render: function(h) {
|
58 |
| - return h('panel-screen', [ |
| 58 | + // using built-in `pin` panel header control; can use either `this.isPinned` getter method or the `this.panel.isPinned` panel getter |
| 59 | + const pin = |
| 60 | + this.$iApi.screenSize === 'xs' |
| 61 | + ? undefined |
| 62 | + : h('pin', { props: { active: this.isPinned }, on: { click: () => this.panel.pin(!this.panel.isPinned) } }); |
| 63 | + |
| 64 | + const close = |
| 65 | + this.$iApi.screenSize === 'xs' |
| 66 | + ? undefined |
| 67 | + : h('close', { |
| 68 | + on: { |
| 69 | + click: () => this.panel.close() // this works ✔ |
| 70 | + // click: this.closeMethod, // this also works ✔ |
| 71 | + // click: this.panel.close // this doesn't work ❌ |
| 72 | + } |
| 73 | + }); |
| 74 | + |
| 75 | + return h('panel-screen', { props: { panel: this.panel } }, [ |
59 | 76 | // pass a `span` to the `header` slot of the panel-screen
|
60 | 77 | h('template', { slot: 'header' }, [h('span', this.title)]),
|
61 | 78 |
|
62 | 79 | // pass `pin` and `close` controls `controls` slot of the panel-screen
|
63 |
| - h('template', { slot: 'controls' }, [ |
64 |
| - // using built-in `pin` panel header control; can use either `this.isPinned` getter method or the `this.panel.isPinned` panel getter |
65 |
| - h('pin', { props: { active: this.isPinned }, on: { click: () => this.panel.pin(!this.panel.isPinned) } }), |
66 |
| - |
67 |
| - // using built-in `close` panel header control |
68 |
| - h('close', { |
69 |
| - on: { |
70 |
| - click: () => this.panel.close() // this works ✔ |
71 |
| - // click: this.closeMethod, // this also works ✔ |
72 |
| - // click: this.panel.close // this doesn't work ❌ |
73 |
| - } |
74 |
| - }) |
75 |
| - ]), |
| 80 | + h('template', { slot: 'controls' }, [pin, close]), |
76 | 81 |
|
77 | 82 | // pass screen content to the `header` slot of the panel-screen
|
78 | 83 | h('template', { slot: 'content' }, [
|
|
168 | 173 |
|
169 | 174 | // TEMP CODE FOR SAMPLE
|
170 | 175 | // will allow an outside caller to update the fixture
|
171 |
| - doAThing (text) { |
| 176 | + doAThing(text) { |
172 | 177 | // too dumb do figure out how to get text on the fixture panels. vue hates me.
|
173 | 178 | console.log('EVENTS API SAMPLE: dillygord got this data from gazebo', text);
|
174 | 179 | }
|
|
0 commit comments