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
> Only background image, you must give the height of the element
38
46
39
47
```vue
40
-
<GeoPattern style="height: 80px;" />
48
+
<GeoPattern style="height: 160px;" />
49
+
```
50
+
51
+
### Custom pattern
52
+
53
+
If you don't provide a seed, the pattern's seed is random.
54
+
55
+
In VuePress you can use [global computed properties](https://vuepress.vuejs.org/guide/global-computed.html) such as use `this.$page.title` as a seed, generate a geopattern by the page title.
56
+
57
+
Each page title is different, so you got difference geopattern.
58
+
59
+
```vue
60
+
<GeoPattern
61
+
style="height: 160px;"
62
+
seed="$page.title"
63
+
:colorHexs="['F', '4', 'A']"
64
+
/>
41
65
```
42
66
43
-
> With the custom slot, in the case, you can let the slot element control the pattern's height
67
+
### With the custom slot
68
+
69
+
> In the case, you can let the slot element control the pattern's height
44
70
45
71
```vue
46
72
<geo-pattern>
@@ -56,13 +82,18 @@ module.exports = {
56
82
57
83
| Props | Description | Type | Default |
58
84
| :---: | :---------: | :--: | :-----: |
59
-
| colorHexs | Given array elements is hexadecimal color value [0-F]| Array |`['3', '9' 'C' ]`|
85
+
| seed | Will be used as the seed for generation | String |`vuepress-plugin-geopattern`|
86
+
| colorHexs | Given array elements is hexadecimal color value [0-F]| Array |`['3', '9', 'C' ]`|
60
87
| baseColor | Controls the relative background color of the generated image. | String |`933c3c`|
61
88
62
89
## Slot
63
90
64
91
`<GeoPattern />` component provide a custom slot, you can write some element on the generated pattern.
65
92
93
+
## Related VuePress Plugin
94
+
95
+
*[vuepress-plugin-hero-pattern](https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern) - Hero Patterns is a set of repeatable, seemless SVG background patterns
96
+
66
97
## License
67
98
68
-
MIT
99
+
MIT @ [xiaoluoboding](https://github.com/xiaoluoboding)
0 commit comments