bootstrap-vue-top 1.0.14 → 1.0.16
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/README.md +50 -1
- package/README.zh-CN.md +50 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,12 +26,13 @@ npm install bootstrap-vue-top
|
|
|
26
26
|
|
|
27
27
|
## Quick Start
|
|
28
28
|
|
|
29
|
+
**main.js**
|
|
29
30
|
```javascript
|
|
30
31
|
import { createApp } from 'vue'
|
|
31
32
|
import App from './App.vue'
|
|
32
33
|
|
|
33
34
|
// Import styles (Bootstrap 5 styles are already included—do NOT import them again)
|
|
34
|
-
import 'bootstrap-vue-top/
|
|
35
|
+
import 'bootstrap-vue-top/style.css'
|
|
35
36
|
// Import Vue components (Bootstrap 5 JS components are already bundled—do NOT import them again)
|
|
36
37
|
import BootstrapVueTop from 'bootstrap-vue-top'
|
|
37
38
|
|
|
@@ -40,6 +41,54 @@ app.use(BootstrapVueTop)
|
|
|
40
41
|
app.mount('#app')
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
**App.vue**
|
|
45
|
+
```javascript
|
|
46
|
+
<template>
|
|
47
|
+
<div class="container p-3">
|
|
48
|
+
<h1 class="text-primary text-center">Hello</h1>
|
|
49
|
+
|
|
50
|
+
<h4 class="mt-4">Example 1 (Vue component)</h4>
|
|
51
|
+
<bv-table :data="tableData" table-class="table-bordered">
|
|
52
|
+
<bv-table-col header="Code" field="code" />
|
|
53
|
+
<bv-table-col header="Name" field="name" />
|
|
54
|
+
<bv-table-col header="Address" field="address" />
|
|
55
|
+
</bv-table>
|
|
56
|
+
|
|
57
|
+
<h4 class="mt-4">Example 2 (Bootstrap component)</h4>
|
|
58
|
+
<div>
|
|
59
|
+
<button ref="popoverRef" type="button" class="btn btn-primary" data-bs-toggle="popover"
|
|
60
|
+
data-bs-title="Popover title"
|
|
61
|
+
data-bs-content="And here’s some amazing content. It’s very engaging. Right?">Click to toggle
|
|
62
|
+
popover</button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup>
|
|
68
|
+
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
69
|
+
|
|
70
|
+
const tableData = ref([
|
|
71
|
+
{ code: 1001, name: 'Kris1', address: 'Honghu City, Hubei Province, China' },
|
|
72
|
+
{ code: 1002, name: 'Kris2', address: 'Honghu City, Hubei Province, China' },
|
|
73
|
+
{ code: 1003, name: 'Kris3', address: 'Honghu City, Hubei Province, China' }
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
// Bootstrap component
|
|
77
|
+
import { bootstrap } from 'bootstrap-vue-top'
|
|
78
|
+
const popoverRef = ref(null)
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
// Instantiate the Bootstrap component
|
|
81
|
+
new bootstrap.Popover(popoverRef.value, {
|
|
82
|
+
container: 'body'
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
onBeforeUnmount(() => {
|
|
86
|
+
// Destroy the Bootstrap component
|
|
87
|
+
bootstrap.Popover.getInstance(popoverRef.value).dispose();
|
|
88
|
+
})
|
|
89
|
+
</script>
|
|
90
|
+
```
|
|
91
|
+
|
|
43
92
|
|
|
44
93
|
## Development
|
|
45
94
|
|
package/README.zh-CN.md
CHANGED
|
@@ -27,12 +27,13 @@ npm install bootstrap-vue-top
|
|
|
27
27
|
|
|
28
28
|
## 快速开始
|
|
29
29
|
|
|
30
|
+
**main.js**
|
|
30
31
|
```javascript
|
|
31
32
|
import { createApp } from 'vue'
|
|
32
33
|
import App from './App.vue'
|
|
33
34
|
|
|
34
35
|
// 引入样式(已包括bootstrap 5 样式,切记不要再次引入。)
|
|
35
|
-
import 'bootstrap-vue-top/
|
|
36
|
+
import 'bootstrap-vue-top/style.css'
|
|
36
37
|
// 引入Vue组件(已打包bootstrap 5 JS组件,切记不要再次引入。)
|
|
37
38
|
import BootstrapVueTop from 'bootstrap-vue-top'
|
|
38
39
|
|
|
@@ -41,6 +42,54 @@ app.use(BootstrapVueTop)
|
|
|
41
42
|
app.mount('#app')
|
|
42
43
|
```
|
|
43
44
|
|
|
45
|
+
**App.vue**
|
|
46
|
+
```html
|
|
47
|
+
<template>
|
|
48
|
+
<div class="container p-3">
|
|
49
|
+
<h1 class="text-primary text-center">Hello</h1>
|
|
50
|
+
|
|
51
|
+
<h4 class="mt-4">Example 1 (vue 组件)</h4>
|
|
52
|
+
<bv-table :data="tableData" table-class="table-bordered">
|
|
53
|
+
<bv-table-col header="Code" field="code" />
|
|
54
|
+
<bv-table-col header="Name" field="name" />
|
|
55
|
+
<bv-table-col header="Address" field="address" />
|
|
56
|
+
</bv-table>
|
|
57
|
+
|
|
58
|
+
<h4 class="mt-4">Example 2 (Bootstrap 组件)</h4>
|
|
59
|
+
<div>
|
|
60
|
+
<button ref="popoverRef" type="button" class="btn btn-primary" data-bs-toggle="popover"
|
|
61
|
+
data-bs-title="Popover title"
|
|
62
|
+
data-bs-content="And here’s some amazing content. It’s very engaging. Right?">Click to toggle
|
|
63
|
+
popover</button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup>
|
|
69
|
+
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
70
|
+
|
|
71
|
+
const tableData = ref([
|
|
72
|
+
{ code: 1001, name: 'Kris1', address: 'Honghu City, Hubei Province, China' },
|
|
73
|
+
{ code: 1002, name: 'Kris2', address: 'Honghu City, Hubei Province, China' },
|
|
74
|
+
{ code: 1003, name: 'Kris3', address: 'Honghu City, Hubei Province, China' }
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
// Bootstrap 组件
|
|
78
|
+
import { bootstrap } from 'bootstrap-vue-top'
|
|
79
|
+
const popoverRef = ref(null)
|
|
80
|
+
onMounted(() => {
|
|
81
|
+
// 实例化 Bootstrap 组件
|
|
82
|
+
new bootstrap.Popover(popoverRef.value, {
|
|
83
|
+
container: 'body'
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
onBeforeUnmount(() => {
|
|
87
|
+
// 销毁 Bootstrap 组件
|
|
88
|
+
bootstrap.Popover.getInstance(popoverRef.value).dispose();
|
|
89
|
+
})
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
44
93
|
|
|
45
94
|
## 开发
|
|
46
95
|
|