yh-mobile-components 1.0.7 → 1.0.8

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/info/yhmList.vue CHANGED
@@ -56,7 +56,7 @@
56
56
  <yhm-info class="yhm-list-item-actions">
57
57
  <template v-for="btn in listConfig.btns">
58
58
  <div
59
- v-if="!item.show || (item.show && item.show(row))"
59
+ v-if="!btn.show || (btn.show && btn.show(row))"
60
60
  :class="`yhm-list-btn${btn.type ? ' ' + btn.type : ''}`"
61
61
  @click="() => btn.callback(row)">
62
62
  {{ btn.text }}
package/info/yhmTable.vue CHANGED
@@ -2,19 +2,28 @@
2
2
  <section class="yhm-table-container">
3
3
  <table class="yhm-table">
4
4
  <colgroup>
5
+ <col
6
+ v-if="hasIndex"
7
+ width="50" />
5
8
  <col
6
9
  v-for="col in columns"
7
10
  :width="col.width"
8
11
  :align="col.align" />
9
12
  </colgroup>
10
13
  <tr>
14
+ <th v-if="hasIndex">#</th>
11
15
  <th
12
16
  v-for="column in columns"
13
17
  :align="column.align">
14
18
  {{ column.label }}
15
19
  </th>
16
20
  </tr>
17
- <tr v-for="row in data">
21
+ <tr v-for="(row, index) in data">
22
+ <td
23
+ aling="center"
24
+ v-if="hasIndex">
25
+ {{ index + 1 }}
26
+ </td>
18
27
  <td
19
28
  v-for="column in columns"
20
29
  :align="column.align">
@@ -49,8 +58,11 @@ const tableWidth = computed(() => {
49
58
  }
50
59
  return accumulator + w;
51
60
  }, 0);
52
-
53
- return width === 0 ? "100%" : `${width}px`;
61
+ if (props.hasIndex) {
62
+ return width === 0 ? "100%" : `${width + 50}px`;
63
+ } else {
64
+ return width === 0 ? "100%" : `${width}px`;
65
+ }
54
66
  });
55
67
  </script>
56
68
  <style lang="scss">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yh-mobile-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "移动端组件封装及配置化需求",
5
5
  "main": "index.js",
6
6
  "scripts": {