gyyg-components 0.2.11 → 0.2.13

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": "gyyg-components",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -12,12 +12,12 @@
12
12
  :start-placeholder="startPlaceholder"
13
13
  :end-placeholder="endPlaceholder"
14
14
  :range-separator="rangeSeparator"
15
+ :value-format="valueFormat"
15
16
  style="width: 100%;">
16
17
  </el-date-picker>
17
18
  </div>
18
19
  </template>
19
20
  <script>
20
- import moment from 'moment';
21
21
  export default {
22
22
  name: 'mec-date-picker',
23
23
  props: {
@@ -60,7 +60,7 @@ export default {
60
60
  },
61
61
  valueFormat: {
62
62
  type: String,
63
- default: ''
63
+ default: 'yyyy-MM-dd'
64
64
  }
65
65
 
66
66
  },
@@ -71,9 +71,7 @@ export default {
71
71
  },
72
72
  methods: {
73
73
  change(val) {
74
- const formattedValue = val ? moment(val).format(this.valueFormat) : '';
75
- this.$emit('change', formattedValue);
76
- this.$emit('input', formattedValue);
74
+ this.$emit('change', val);
77
75
  }
78
76
  },
79
77
  watch: {
@@ -85,9 +83,7 @@ export default {
85
83
  },
86
84
  date: {
87
85
  handler(val) {
88
- // 将内部的 Date 对象格式化后传递给父组件
89
- const formattedValue = val ? moment(val).format(this.valueFormat) : '';
90
- this.$emit('input', formattedValue);
86
+ this.$emit('input', val);
91
87
  }
92
88
 
93
89
  }
@@ -14,7 +14,6 @@
14
14
  >
15
15
  </el-transfer>
16
16
  </template>
17
- </template>
18
17
  <script>
19
18
  import Sortable from 'sortablejs';
20
19
  export default {