@@ -261,7 +261,7 @@ api.describeTask({
261
261
}
262
262
],
263
263
// Default selected view when displaying the task details (by default it's the output)
264
- defaultView: ' vue-webpack-dashboard'
264
+ defaultView: ' vue-webpack-dashboard-client-addon '
265
265
})
266
266
```
267
267
@@ -388,10 +388,21 @@ api.describeTask({
388
388
}
389
389
],
390
390
// Default selected view when displaying the task details (by default it's the output)
391
- defaultView: ' vue-webpack-dashboard'
391
+ defaultView: ' vue-webpack-dashboard-client-addon '
392
392
})
393
393
```
394
394
395
+ Here is the client addon code that register the ` 'vue-webpack-dashboard' ` component (like we saw earlier):
396
+
397
+ ``` js
398
+ /* In `main.js` */
399
+ // Import the component
400
+ import WebpackDashboard from ' ./components/WebpackDashboard.vue'
401
+ // Register a custom component
402
+ // (works like 'Vue.component')
403
+ ClientAddonApi .component (' vue-webpack-dashboard' , WebpackDashboard)
404
+ ```
405
+
395
406
![ Task view example] ( ./task-view.png )
396
407
397
408
### Custom views
@@ -417,6 +428,21 @@ api.addView({
417
428
})
418
429
```
419
430
431
+ Here is the code in the client addon that register the ` 'test-webpack-route' ` (like we saw earlier):
432
+
433
+ ``` js
434
+ /* In `main.js` */
435
+ // Import the component
436
+ import TestView from ' ./components/TestView.vue'
437
+ // Add routes to vue-router under a /addon/<id> parent route.
438
+ // For example, addRoutes('foo', [ { path: '' }, { path: 'bar' } ])
439
+ // will add the /addon/foo/ and the /addon/foo/bar routes to vue-router.
440
+ // Here we create a new '/addon/vue-webpack/' route with the 'test-webpack-route' name
441
+ ClientAddonApi .addRoutes (' vue-webpack' , [
442
+ { path: ' ' , name: ' test-webpack-route' , component: TestView }
443
+ ])
444
+ ```
445
+
420
446
![ Custom view example] ( ./custom-view.png )
421
447
422
448
### Shared data
0 commit comments