Skip to content

Commit 6192dbe

Browse files
authored
docs(setup): Incorporate docs from repo README.md
1 parent bc7ca26 commit 6192dbe

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

docs/SETUP.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,63 @@
44
If you are using module bundlers such as Webpack, Rollup, Laravel elixir/mix, etc you may prefer directly include package
55
into your project. To get started use yarn or npm to get latest version.
66

7-
```sh
7+
8+
1. Download dependencies:
9+
```bash
810
# Using YARN
911
yarn add bootstrap-vue
12+
yarn add bootstrap@4.0.0-alpha.6
13+
yarn add -D style-loader
1014

1115
# Using NPM
1216
npm install --save bootstrap-vue
1317
```
1418

15-
Register BootstrapVue in your app entrypoint:
16-
19+
2. Register BootstrapVue in your app entrypoint:
1720
```js
1821
import Vue from 'vue'
1922
import BootstrapVue from 'bootstrap-vue';
2023

2124
Vue.use(BootstrapVue);
2225
```
2326

24-
Import styles using style-loader:
27+
3. Import styles using style-loader:
2528
```js
2629
import 'bootstrap/dist/css/bootstrap.css'
2730
import 'bootstrap-vue/dist/bootstrap-vue.css'
2831
```
29-
If style-loader is not available, you have to manually include both bootstrap and bootstrap-vue css files in your css bundle
32+
33+
##### For users of Webpack or Webpack-Simple from `vue-cli` follow these instructions:
34+
1. Download the dependencies:
35+
```bash
36+
yarn add bootstrap-vue
37+
yarn add bootstrap@4.0.0-alpha.6
38+
yarn add -D style-loader
39+
```
40+
41+
2. In `src/main.js`, add the following lines, in priority order:
42+
```js
43+
import Vue from 'vue';
44+
/* ( there may be other imports here ) */
45+
import BootstrapVue from 'bootstrap-vue/dist/bootstrap-vue.esm';
46+
import 'bootstrap-vue/dist/bootstrap-vue.css';
47+
import 'bootstrap/dist/css/bootstrap.css';
48+
/* ( there may be other imports here ) */
49+
50+
Vue.use(BootstrapVue);
51+
```
52+
53+
#### Note on style-loader:
54+
If you are unable or do not want to add style-loader as a developer dependency, you have to
55+
manually include both [Bootstrap's](https://v4-alpha.getbootstrap.com/getting-started/download/)
56+
and [BootstrapVue's](https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css) CSS files
57+
in your bundle or reference them from `static/` via `index.html`.
58+
3059

3160
#### Using individual components and directives
3261
If for any reason just want to use a specific component, you can do this by directly importing that component.
3362
This is not recommended as entire package gzipped size is ~15Kb and requires a supported vue bundler.
63+
3464
```js
3565
import {bAlert, bBtn, bCollapse} from 'bootstrap-vue/lib/components'
3666
import (bToggle, bScrollspy} from 'bootstrap-vue/lib/directives'
@@ -48,8 +78,6 @@ new Vue({
4878
},
4979
// ...
5080
})
51-
52-
5381
```
5482
5583
### CDN (Browser)

0 commit comments

Comments
 (0)