Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 9567c5c

Browse files
committed
修改readme.md文件
1 parent 942af95 commit 9567c5c

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,53 @@
1818
## 使用
1919

2020
> npm(yarn)安装
21+
2122
``` bash
2223
npm i vue-bootstrap-selectpicker # yarn add vue-bootstrap-selectpicker
2324
```
2425

25-
> 浏览器中
26+
``` js
27+
// 在main.js里面加入以下代码
28+
import 'vue-bootstrap-selectpicker/css/vue-bootstrap-selectpicker.min.css'
29+
import SelectPicker from 'vue-bootstrap-selectpicker'
30+
31+
Vue.use(SelectPicker)
32+
```
33+
34+
> 浏览器
35+
36+
``` html
37+
<head>
38+
...
39+
<link ref="stylesheet" href="/vue-bootstrap-selectpicker/css/vue-bootstrap-selectpicker.min.css">
40+
</head>
41+
<body>
42+
...
43+
<script src="/vue-bootstrap-selectpicker/js/vue-bootstrap-selectpicker.min.js"></script>
44+
</body>
45+
```
46+
47+
> 示例
48+
49+
``` vue | html
50+
<select-picker :dropdown-data="dropdownData" placeholder="请选择..." v-model="defaultSelectText" @changeSelect="changeSelect" />
51+
```
52+
53+
``` js
54+
export default {
55+
data () {
56+
return {
57+
...
58+
dropdownData: ['Vue', 'React', 'Angular', 'jQuery'],
59+
defaultSelectText: ''
60+
}
61+
},
62+
methods: {
63+
...
64+
changeSelect (data, text) {
65+
console.log(data)
66+
this.defaultSelectText = text
67+
}
68+
}
69+
}
70+
```

show.gif

-2.56 MB
Loading

0 commit comments

Comments
 (0)