You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library is a Vue.js plugin providing you with an element which acts as extension point. This extension has a named "hook". Plugins then can provide components for this extension point which are automatically found and rendered replacing the extension.
4
4
5
-
It's written in ES6. It's my first Js/Vue software, so:
5
+
## Install
6
6
7
-
1. Be patient - don't expect professional code.
8
-
2. Be helpful - hints and PRs for improvements are welcome.
7
+
```bash
8
+
# does not work yet...
9
+
# npm install vue-extensionpoints
10
+
```
9
11
10
12
## Usage
11
13
```javascript
12
14
// main.js
13
-
importExtensionsfrom'vue-extensions'
14
-
importfoofrom'./plugins/foo'
15
+
importExtensionsfrom'vue-extensionpoints'
16
+
importfoofrom'@/plugins/foo'
15
17
16
18
Vue.use(Extensions, {plugins: {foo}})
17
19
@@ -20,7 +22,9 @@ new Vue({
20
22
})
21
23
```
22
24
23
-
This is all you need for having now an `<extension>` tag available anywhere:
25
+
You can import the `options` object from a file that can be created automatially, depending on how you have structured your plugin structures.
26
+
27
+
You have an `<extension>` tag available now:
24
28
25
29
```html
26
30
<template>
@@ -32,8 +36,9 @@ This is all you need for having now an `<extension>` tag available anywhere:
vue-extensions finds this file and renders the two elements instead of the <extension> element. You have to make sure that your components do what they promise: in this case, FooListElement should render a <li> element containing some things.
47
-
48
-
### Project setup
49
-
```
50
-
npm install
51
-
```
51
+
vue-extensionpoints finds this file and renders the hooked elements replacing the <extension> element, one after another. You have to make sure that your components do what they promise: in this case, FooListElement should render a <li> element - because it will be rendered within an <ul> element. But thee are no constraints, you are free to choose whatever you want here.
52
52
53
-
#### Compiles and hot-reloads for development
54
-
```
55
-
npm run serve
56
-
```
57
53
58
-
#### Compiles and minifies library for production
54
+
#### Compile and minifies library for production
59
55
```
60
56
npm run build-lib
61
57
```
@@ -69,6 +65,3 @@ npm run test
69
65
```
70
66
npm run lint
71
67
```
72
-
73
-
#### Customize configuration
74
-
See [Configuration Reference](https://cli.vuejs.org/config/).
0 commit comments