bootstrap-vue-wrapper 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="offcanvasRef"
|
|
4
|
+
class="offcanvas"
|
|
5
|
+
tabindex="-1"
|
|
6
|
+
aria-labelledby="offcanvasTitle"
|
|
7
|
+
>
|
|
8
|
+
<div class="offcanvas-header">
|
|
9
|
+
<slot name="header">
|
|
10
|
+
<div id="offcanvasTitle" class="h5 mb-0" v-text="title" />
|
|
11
|
+
<button
|
|
12
|
+
type="button"
|
|
13
|
+
class="btn-close text-reset"
|
|
14
|
+
data-bs-dismiss="offcanvas"
|
|
15
|
+
/>
|
|
16
|
+
</slot>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="offcanvas-body">
|
|
19
|
+
<slot name="body" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { Offcanvas } from 'bootstrap'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'BsOffcanvas',
|
|
29
|
+
props: {
|
|
30
|
+
/**
|
|
31
|
+
* Offcanvas title
|
|
32
|
+
*/
|
|
33
|
+
title: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
emits: ['shown', 'hidden'],
|
|
39
|
+
mounted() {
|
|
40
|
+
const offcanvasElemet = this.$refs.offcanvasRef
|
|
41
|
+
Offcanvas.getOrCreateInstance(offcanvasElemet).show()
|
|
42
|
+
|
|
43
|
+
offcanvasElemet.addEventListener('shown.bs.offcanvas', this.onShown)
|
|
44
|
+
offcanvasElemet.addEventListener('hidden.bs.offcanvas', this.onHidden)
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
/**
|
|
48
|
+
* Trigger offcanvas hide event.
|
|
49
|
+
*/
|
|
50
|
+
hide() {
|
|
51
|
+
Offcanvas.getOrCreateInstance(this.$refs.offcanvasRef).hide()
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Hidden event.
|
|
55
|
+
*/
|
|
56
|
+
onShown() {
|
|
57
|
+
this.$emit('shown')
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Hidden event.
|
|
61
|
+
*/
|
|
62
|
+
onHidden() {
|
|
63
|
+
this.$emit('hidden')
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,8 @@ import BsTable from './components/bs-table/BsTable.vue'
|
|
|
8
8
|
import BsToast from './components/bs-toast/BsToast.vue'
|
|
9
9
|
import BsModal from './components/bs-modal/BsModal.vue'
|
|
10
10
|
import BsSelect from './components/bs-select/BsSelect.vue'
|
|
11
|
+
import BsRadio from './components/bs-radio/BsRadio.vue'
|
|
12
|
+
import BsOffcanvas from './components/bs-offcanvas/BsOffcanvas.vue'
|
|
11
13
|
import Validator from './mixins/validator.js'
|
|
12
14
|
|
|
13
15
|
export {
|
|
@@ -21,5 +23,7 @@ export {
|
|
|
21
23
|
BsToast,
|
|
22
24
|
BsModal,
|
|
23
25
|
BsSelect,
|
|
26
|
+
BsRadio,
|
|
24
27
|
Validator,
|
|
28
|
+
BsOffcanvas,
|
|
25
29
|
}
|