mali-applet-ui 0.1.69 → 0.1.71

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.
@@ -40,6 +40,7 @@ export default {
40
40
 
41
41
  <style lang="scss">
42
42
  .ml-col {
43
+ white-space: normal;
43
44
  $spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
44
45
  37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
45
46
  70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
@@ -72,11 +72,22 @@ export default {
72
72
  }
73
73
  },
74
74
  watch: {
75
- checked () {
76
-
75
+ checked (vals) {
76
+ if (!this.updateModel) {
77
+ this.selection = []
78
+ this.setCheckboxRow(vals, true)
79
+ }
80
+ this.updateModel = false
77
81
  }
78
82
  },
79
83
  created () {
84
+ if (this.checked) {
85
+ if (this.type === 'checkbox') {
86
+ this.selection = this.checked
87
+ } else if (this.type === 'radio') {
88
+ this.selectValue = this.checked
89
+ }
90
+ }
80
91
  this.$nextTick(() => {
81
92
  if (this.autoload && this.requestMethod) {
82
93
  this.reload()
@@ -162,6 +173,7 @@ export default {
162
173
  },
163
174
  updateChecked () {
164
175
  let rest = null
176
+ this.updateModel = true
165
177
  if (this.type === 'checkbox') {
166
178
  rest = this.selection
167
179
  this.$emit('update:checked', rest)
@@ -47,9 +47,28 @@ export default {
47
47
  return this.height ? `height: ${this.height};` : ''
48
48
  }
49
49
  },
50
+ watch: {
51
+ checked (vals) {
52
+ if (!this.updateModel) {
53
+ this.selection = []
54
+ this.setCheckboxRow(vals, true)
55
+ }
56
+ this.updateModel = false
57
+ }
58
+ },
59
+ created () {
60
+ if (this.checked) {
61
+ if (this.type === 'checkbox') {
62
+ this.selection = this.checked
63
+ } else if (this.type === 'radio') {
64
+ this.selectValue = this.checked
65
+ }
66
+ }
67
+ },
50
68
  methods: {
51
69
  updateChecked () {
52
70
  let rest = null
71
+ this.updateModel = true
53
72
  if (this.type === 'checkbox') {
54
73
  rest = this.selection
55
74
  this.$emit('update:checked', rest)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",