|
| 1 | +<script lang="ts"> |
| 2 | +import { defineComponent, ref, watch } from '@vue/composition-api' |
| 3 | +
|
| 4 | +export default defineComponent({ |
| 5 | + emits: [ |
| 6 | + 'hide', |
| 7 | + ], |
| 8 | +
|
| 9 | + setup () { |
| 10 | + const step = ref(0) |
| 11 | + const content = ref<HTMLDivElement>() |
| 12 | +
|
| 13 | + watch(step, () => { |
| 14 | + content.value.scrollTop = 0 |
| 15 | + }) |
| 16 | +
|
| 17 | + return { |
| 18 | + step, |
| 19 | + stepMax: 10, |
| 20 | + content, |
| 21 | + } |
| 22 | + }, |
| 23 | +}) |
| 24 | +</script> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div class="bg-white/50 dark:bg-black/50 p-4 flex items-center justify-center"> |
| 28 | + <div class="bg-white dark:bg-black rounded-lg shadow-lg border border-gray-200 dark:border-gray-800 h-full w-[620px] max-w-full flex flex-col"> |
| 29 | + <div |
| 30 | + ref="content" |
| 31 | + class="flex-1 overflow-auto p-4" |
| 32 | + > |
| 33 | + <template v-if="step === 0"> |
| 34 | + <img |
| 35 | + src="~@front/assets/devtools-logo.svg" |
| 36 | + alt="Devtools logo" |
| 37 | + class="logo max-h-[160px]" |
| 38 | + > |
| 39 | + <h1 class="text-green-500 text-2xl text-center mt-8"> |
| 40 | + Welcome to the Vue devtools! |
| 41 | + </h1> |
| 42 | + </template> |
| 43 | + |
| 44 | + <template v-if="step === 1"> |
| 45 | + <h2>Let's have little tour</h2> |
| 46 | + |
| 47 | + <p> |
| 48 | + The devtools were entirely rewritten with the release of Vue 3. |
| 49 | + </p> |
| 50 | + |
| 51 | + <p> |
| 52 | + Its new architecture allow better support of different versions of Vue and also integration of third-party libraries (more on that later!). |
| 53 | + </p> |
| 54 | + |
| 55 | + <p> |
| 56 | + It's packed with changes big and small so here is an overview of what's new! |
| 57 | + </p> |
| 58 | + </template> |
| 59 | + |
| 60 | + <template v-if="step === 2"> |
| 61 | + <img |
| 62 | + src="~@front/assets/welcome/main-tabs.png" |
| 63 | + alt="Main tabs" |
| 64 | + class="max-h-[120px]" |
| 65 | + > |
| 66 | + |
| 67 | + <p> |
| 68 | + You might notice that the navigation is different. The devtools now has to main tabs: |
| 69 | + </p> |
| 70 | + |
| 71 | + <ul> |
| 72 | + <li>the <b>Inspector</b> to display debuging information in a structured way (for example inspecting a component),</li> |
| 73 | + <li>the <b>Timeline</b> to track different kinds of data over time such as events.</li> |
| 74 | + </ul> |
| 75 | + </template> |
| 76 | + |
| 77 | + <template v-if="step === 3"> |
| 78 | + <h2>The Inspector</h2> |
| 79 | + |
| 80 | + <p> |
| 81 | + Here you can select components and inspect their state. |
| 82 | + </p> |
| 83 | + |
| 84 | + <img |
| 85 | + src="~@front/assets/welcome/components.png" |
| 86 | + alt="Components inspector" |
| 87 | + > |
| 88 | + </template> |
| 89 | + |
| 90 | + <template v-if="step === 4"> |
| 91 | + <p> |
| 92 | + To acess settings, use the new "3 dots" menu in the top right corner. |
| 93 | + </p> |
| 94 | + |
| 95 | + <img |
| 96 | + src="~@front/assets/welcome/components-menu.png" |
| 97 | + alt="Components menu" |
| 98 | + class="max-h-[270px]" |
| 99 | + > |
| 100 | + </template> |
| 101 | + |
| 102 | + <template v-if="step === 5"> |
| 103 | + <p> |
| 104 | + Vue plugins and libraries can now integrate with the devtools via its <a |
| 105 | + href="https://devtools.vuejs.org/plugin/plugins-guide.html" |
| 106 | + target="_blank" |
| 107 | + >Plugin API</a>. |
| 108 | + </p> |
| 109 | + |
| 110 | + <p> |
| 111 | + For example, they can add their own custom inspectors: |
| 112 | + </p> |
| 113 | + |
| 114 | + <img |
| 115 | + src="~@front/assets/welcome/inspector-pinia2.png" |
| 116 | + alt="Pinia inspector" |
| 117 | + > |
| 118 | + </template> |
| 119 | + |
| 120 | + <template v-if="step === 6"> |
| 121 | + <h2>The Timeline</h2> |
| 122 | + |
| 123 | + <p> |
| 124 | + Here you can see the events coming from your application in real time. It includes mouse and keyboard events, component events, performance flamecharts... |
| 125 | + </p> |
| 126 | + |
| 127 | + <img |
| 128 | + src="~@front/assets/welcome/timeline.png" |
| 129 | + alt="Timeline" |
| 130 | + > |
| 131 | + </template> |
| 132 | + |
| 133 | + <template v-if="step === 7"> |
| 134 | + <p> |
| 135 | + You can zoom and pan the timeline, and click on events to see more information. |
| 136 | + </p> |
| 137 | + |
| 138 | + <img |
| 139 | + src="~@front/assets/welcome/timeline-perf2.png" |
| 140 | + alt="Timeline" |
| 141 | + > |
| 142 | + </template> |
| 143 | + |
| 144 | + <template v-if="step === 8"> |
| 145 | + <p> |
| 146 | + Using the <a |
| 147 | + href="https://devtools.vuejs.org/plugin/plugins-guide.html" |
| 148 | + target="_blank" |
| 149 | + >Devtools Plugin API</a>, third-party libraries can also add layers and events in the Timline. |
| 150 | + </p> |
| 151 | + |
| 152 | + <img |
| 153 | + src="~@front/assets/welcome/timeline-pinia.png" |
| 154 | + alt="Timeline pinia" |
| 155 | + > |
| 156 | + </template> |
| 157 | + |
| 158 | + <template v-if="step === 9"> |
| 159 | + <p> |
| 160 | + On the left side of the top-bar, you can find a new App Selector. The devtools are now scoped to a specific selected app and can even inspect apps inside iframes! |
| 161 | + </p> |
| 162 | + |
| 163 | + <img |
| 164 | + src="~@front/assets/welcome/app-selector.png" |
| 165 | + alt="App selector" |
| 166 | + class="max-h-[280px]" |
| 167 | + > |
| 168 | + </template> |
| 169 | + |
| 170 | + <template v-if="step === 10"> |
| 171 | + <img |
| 172 | + src="~@front/assets/devtools-logo.svg" |
| 173 | + alt="Devtools logo" |
| 174 | + class="logo max-h-[100px]" |
| 175 | + > |
| 176 | + |
| 177 | + <h2 class="text-center mb-8"> |
| 178 | + That's it! |
| 179 | + </h2> |
| 180 | + |
| 181 | + <p> |
| 182 | + We hope you will enjoy the new Vue devtools. |
| 183 | + </p> |
| 184 | + |
| 185 | + <p> |
| 186 | + In case something doesn't work in your project, you can use the <a |
| 187 | + href="https://devtools.vuejs.org/guide/faq.html#something-is-broken-in-the-new-devtools" |
| 188 | + target="_blank" |
| 189 | + >Legacy version</a> and <a |
| 190 | + href="https://new-issue.vuejs.org/?repo=vuejs/vue-devtools" |
| 191 | + target="_blank" |
| 192 | + >report an issue</a>. |
| 193 | + </p> |
| 194 | + </template> |
| 195 | + </div> |
| 196 | + |
| 197 | + <div class="flex-none flex items-center space-x-4 p-4 relative"> |
| 198 | + <div class="absolute top-0 left-0 w-full"> |
| 199 | + <div |
| 200 | + class="h-[2px] bg-green-500 transition-all duration-500 ease-out" |
| 201 | + :style="{ |
| 202 | + width: `${step / stepMax * 100}%` |
| 203 | + }" |
| 204 | + /> |
| 205 | + </div> |
| 206 | + |
| 207 | + <VueButton |
| 208 | + class="flat" |
| 209 | + @click="$emit('hide')" |
| 210 | + > |
| 211 | + Skip |
| 212 | + </VueButton> |
| 213 | + <div class="flex-1" /> |
| 214 | + <VueButton |
| 215 | + :disabled="step === 0" |
| 216 | + @click="step--" |
| 217 | + > |
| 218 | + Previous |
| 219 | + </VueButton> |
| 220 | + <VueButton |
| 221 | + v-if="step < stepMax" |
| 222 | + class="primary w-20" |
| 223 | + @click="step++" |
| 224 | + > |
| 225 | + Next |
| 226 | + </VueButton> |
| 227 | + <VueButton |
| 228 | + v-else |
| 229 | + class="primary w-20" |
| 230 | + @click="$emit('hide')" |
| 231 | + > |
| 232 | + Continue |
| 233 | + </VueButton> |
| 234 | + </div> |
| 235 | + </div> |
| 236 | + </div> |
| 237 | +</template> |
| 238 | + |
| 239 | +<style lang="postcss" scoped> |
| 240 | +p { |
| 241 | + @apply my-2; |
| 242 | +} |
| 243 | +
|
| 244 | +img { |
| 245 | + @apply mx-auto my-4 max-w-full; |
| 246 | +
|
| 247 | + &:first-child { |
| 248 | + @apply mt-0; |
| 249 | + } |
| 250 | +
|
| 251 | + &:not(.logo) { |
| 252 | + @apply border border-gray-200 dark:border-gray-800 rounded-md; |
| 253 | + } |
| 254 | +} |
| 255 | +
|
| 256 | +li { |
| 257 | + @apply list-disc ml-6; |
| 258 | +} |
| 259 | +
|
| 260 | +h2 { |
| 261 | + @apply text-green-500 text-lg; |
| 262 | +} |
| 263 | +
|
| 264 | +a { |
| 265 | + @apply text-green-500; |
| 266 | +} |
| 267 | +</style> |
0 commit comments