|
28 | 28 | </ul>
|
29 | 29 | </div>
|
30 | 30 |
|
31 |
| - <div id="client_content" class="example-content-well"> |
32 |
| - <div v-html="clientContent"></div> |
33 |
| - </div> |
| 31 | + <Content :pageKey="activeClientComponent" id="client_content" class="example-content-well"></Content> |
34 | 32 |
|
35 | 33 | <h2 id="server_setup">Server Setup</h2>
|
36 | 34 |
|
|
56 | 54 | </ul>
|
57 | 55 | </div>
|
58 | 56 |
|
59 |
| - <div id="server_content" class="example-content-well"> |
60 |
| - <div v-html="serverContent"></div> |
61 |
| - </div> |
| 57 | + <Content :pageKey="activeServerComponent" id="server_content" class="example-content-well"></Content> |
62 | 58 | </div>
|
63 | 59 |
|
64 | 60 | <div class="TableOfContents TableOfContentsPreload">
|
|
68 | 64 | </div>
|
69 | 65 | <!-- END Page Content -->
|
70 | 66 | </section>
|
71 |
| - <iframe style="display:none;" id="clientContentIframe" :src="clientContentUrl"></iframe> |
72 |
| - <iframe style="display:none;" id="serverContentIframe" :src="serverContentUrl"></iframe> |
73 | 67 | <Footer/>
|
74 | 68 | </div>
|
75 | 69 | </template>
|
|
86 | 80 | activeClient: null,
|
87 | 81 | activeServer: null,
|
88 | 82 | activeFramework: null,
|
89 |
| - activeTab: null, |
90 |
| - clientContentUrl: null, |
91 |
| - serverContentUrl: null, |
92 |
| - clientContentLoading: true, |
93 |
| - serverContentLoading: true, |
94 |
| - clientContent: "", |
95 |
| - serverContent: "" |
| 83 | + activeTab: null |
96 | 84 | }
|
97 | 85 | },
|
98 | 86 | created: function () {
|
|
131 | 119 | })
|
132 | 120 | return activeServerFrameworks.frameworks
|
133 | 121 | },
|
| 122 | +
|
134 | 123 | activeClientComponent: function () {
|
135 | 124 | let component = this.$site.pages.find((page) => {
|
136 | 125 | return page.regularPath.startsWith('/quickstart-fragments/'+this.activeClient+'/default-example')
|
137 | 126 | })
|
138 | 127 |
|
| 128 | + return component.key |
| 129 | + }, |
| 130 | +
|
| 131 | + activeServerComponent: function () { |
| 132 | + let client = this.$themeConfig.quickstarts.clients.filter((client) => { |
| 133 | + return client.name === this.activeClient |
| 134 | + })[0]; |
| 135 | + let component = this.$site.pages.find((page) => { |
| 136 | + return page.regularPath.startsWith('/quickstart-fragments/' + this.activeServer + '/' + this.activeFramework + '-' + client.serverExampleType + '/') |
| 137 | + }) |
| 138 | +
|
139 | 139 | return component.key
|
140 | 140 | }
|
141 | 141 | },
|
142 | 142 | watch: {
|
143 | 143 | activeClient: function () {
|
144 |
| - this.loadClientContent() |
145 | 144 | window.location.hash = '/'+this.activeClient+'/'+this.activeServer+'/'+this.activeFramework
|
146 | 145 | },
|
147 | 146 | activeServer: function () {
|
|
178 | 177 |
|
179 | 178 | this.activeFramework = frameworkToSet
|
180 | 179 |
|
181 |
| - this.loadServerContent() |
182 | 180 | window.location.hash = '/'+this.activeClient+'/'+this.activeServer+'/'+this.activeFramework
|
183 | 181 | },
|
184 | 182 | activeFramework: function () {
|
185 |
| - this.loadServerContent() |
186 | 183 | window.location.hash = '/'+this.activeClient+'/'+this.activeServer+'/'+this.activeFramework
|
187 | 184 | }
|
188 | 185 | },
|
|
201 | 198 | },
|
202 | 199 | scrollTo: function (element) {
|
203 | 200 | window.scrollTo(0, document.querySelectorAll(element)[0].offsetTop - 150)
|
204 |
| - }, |
205 |
| -
|
206 |
| - loadClientContent: function () { |
207 |
| - this.clientContentLoading = true |
208 |
| -
|
209 |
| - this.clientContentUrl = '/quickstart-fragments/' + this.activeClient + '/default-example/' |
210 |
| -
|
211 |
| -
|
212 |
| - document.getElementById('clientContentIframe').onload = () => { |
213 |
| - this.clientContentLoading = false |
214 |
| - this.clientContent = document.getElementById('clientContentIframe').contentDocument.querySelector('.PageContent-main').innerHTML |
215 |
| - } |
216 |
| - }, |
217 |
| -
|
218 |
| - loadServerContent: function () { |
219 |
| - this.serverContentLoading = true |
220 |
| - let client = this.$themeConfig.quickstarts.clients.filter((client) => { |
221 |
| - return client.name === this.activeClient |
222 |
| - })[0]; |
223 |
| -
|
224 |
| - this.serverContentUrl = '/quickstart-fragments/' + this.activeServer + '/' + this.activeFramework + '-' + client.serverExampleType + '/' |
225 |
| -
|
226 |
| - document.getElementById('serverContentIframe').onload = () => { |
227 |
| - this.serverContentLoading = false |
228 |
| - this.serverContent = document.getElementById('serverContentIframe').contentDocument.querySelector('.PageContent-main').innerHTML |
229 |
| - } |
230 | 201 | }
|
231 | 202 | }
|
232 | 203 | }
|
|
0 commit comments