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
We're about to add much more content to this guide. Stay tuned!
5
+
6
+
Until we have more content in place here, it might be a good idea to review the source code of the [dummy app](https://dummy.matestack.io), which can be found here: [https://github.com/matestack/matestack-ui-bootstrap/tree/main/spec/dummy](https://github.com/matestack/matestack-ui-bootstrap/tree/main/spec/dummy)
7
+
8
+
That should already give you a good idea how to use `matestack-ui-bootstrap`
9
+
{% endhint %}
10
+
11
+
## Usage
12
+
13
+
Create Matestack layouts, pages and components as described in the docs of `matestack-ui-core` and `matestack-ui-vuejs` and utilize the components described in the following docs sections in order to create your UI.
Make sure to install and get to know `matestack-ui-core`first! [https://docs.matestack.io/matestack-ui-core](https://docs.matestack.io/matestack-ui-core)
5
+
Make sure to install and get to know `matestack-ui-core`and `matestack-ui-vuejs` first!
Adjust the relevant application layout and add a div with the ID `matestack-ui`
18
+
and run
15
19
16
-
`app/views/layouts/application.html.erb`
20
+
```
21
+
$ bundle install
22
+
```
17
23
18
-
```text
24
+
### Matestack Ui Core/VueJs install steps (if not already happened)
25
+
26
+
Create a folder called 'matestack' in your app directory. All your Matestack apps, pages and components will be defined there.
27
+
28
+
```
29
+
$ mkdir app/matestack
30
+
```
31
+
32
+
Add the Matestack helper to your controllers. If you want to make the helpers available in all controllers, add it to your 'ApplicationController' this way:
You need to add the ID "matestack-ui" to some part of your application layout (or any layout you use). That's required for Matestack's Vue.js to work properly!
44
+
45
+
For Example, your `app/views/layouts/application.html.erb` should look like this:
This adds the npm package that provides the JavaScript corresponding to the matestack-ui-bootstrap Ruby gem. Make sure that the npm package version matches the gem version. To find out what gem version you are using, you may use `bundle info matestack-ui-bootstrap`.
91
+
92
+
**Note**:
93
+
94
+
* vue3 dropped IE 11 support
95
+
* when using babel alongside webpacker, please adjust your package.json or .browserslistrc config in order to exclude IE 11 support:
96
+
97
+
```json
98
+
{
99
+
"name": "my-app",
100
+
"...": { },
101
+
"browserslist": [
102
+
"defaults",
103
+
"not IE 11"// <-- important!
104
+
]
105
+
}
106
+
```
107
+
108
+
Otherwise you may encounter issues around `regeneratorRuntime` (especially when using Vuex)
109
+
110
+
Next, import and setup 'matestack-ui-vuejs' in your `app/javascript/packs/application.js`
111
+
112
+
```javascript
113
+
import { createApp } from'vue'
114
+
importMatestackUiVueJsfrom'matestack-ui-vuejs'
115
+
116
+
importMatestackUiBootstrapfrom'matestack-ui-bootstrap'// add this
117
+
118
+
constappInstance=createApp({})
119
+
120
+
MatestackUiBootstrap.registerComponents(appInstance) // add this
* extract the bootstrap-icons.svg to this path: app/assets/images/icons \(currently served via assets pipeline, we had issues serving the icons via Webpack\)
85
203
86
204
and finally compile the code with webpack:
@@ -89,12 +207,12 @@ and finally compile the code with webpack:
89
207
$ bin/webpack --watch
90
208
```
91
209
210
+
## Update
211
+
92
212
{% hint style="warning" %}
93
213
When you update the `matestack-ui-bootstrap` Ruby gem, make sure to update the npm package as well!
94
214
{% endhint %}
95
215
96
-
## Update
97
-
98
216
### Ruby Gem
99
217
100
218
Depending on the entry in your Gemfile, you might need to adjust the allowed version ranges in order to update the Gem. After checked and adjusted the version ranges, run:
@@ -109,7 +227,7 @@ and then check the installed version:
109
227
bundle info matestack-ui-bootstrap
110
228
```
111
229
112
-
### JavaScript Package
230
+
### JavaScript Package via Yarn
113
231
114
232
If you've installed the JavaScript dependecies via Yarn/Webpacker you need to update the JavaScript assets via yarn:
115
233
@@ -126,4 +244,3 @@ yarn list --pattern "matestack-ui-bootstrap"
126
244
{% hint style="warning" %}
127
245
The Ruby gem version and the NPM package version should match!
0 commit comments