vsyswin-ui 0.2.62 → 0.2.63

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vsyswin-ui",
3
- "version": "0.2.62",
3
+ "version": "0.2.63",
4
4
  "main": "lib/vsyswin-ui.umd.min.js",
5
5
  "private": false,
6
6
  "description": "Vue2.x的应用组件库.",
@@ -10,17 +10,21 @@ export default {
10
10
  computed: {
11
11
  trigger() {
12
12
  return this.$parent.trigger
13
+ },
14
+ num() {
15
+ return this.$parent.num
13
16
  }
14
17
  },
15
18
  render(h) {
16
19
  let contents = []
17
- if (this.buttons.length <= 3) {
20
+ if (this.buttons.length <= this.num) {
18
21
  contents = this.buttons.map((btn) => {
19
22
  return btn.$slots.default
20
23
  })
21
24
  } else {
22
- const preBtns = this.buttons.slice(0, 2).map((btn) => btn.$slots.default)
23
- const moreBtns = this.buttons.slice(2).map((btn) => {
25
+ const idx = this.num - 1
26
+ const preBtns = this.buttons.slice(0, idx).map((btn) => btn.$slots.default)
27
+ const moreBtns = this.buttons.slice(idx).map((btn) => {
24
28
  const slotDefault = btn.$slots.default
25
29
  const elBtn = slotDefault[0].componentOptions.children[0]
26
30
  const listenersFn = slotDefault[0].componentOptions.listeners.click
@@ -11,10 +11,16 @@
11
11
  name: 'SyButtonList',
12
12
  components: { buttonContainer },
13
13
  props: {
14
+ // 触发下拉框的方式
14
15
  trigger: {
15
16
  type: String,
16
17
  default: 'hover',
17
18
  validator: (value) => ['hover', 'click'].includes(value)
19
+ },
20
+ // 最多显示多少数量的按钮,超过此数量是显示下拉菜单
21
+ num: {
22
+ type: Number,
23
+ default: 3
18
24
  }
19
25
  },
20
26
  data() {