@netang/quasar 0.0.41 → 0.0.42

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.
@@ -97,9 +97,11 @@ export default {
97
97
 
98
98
  // 初始显示前置插槽
99
99
  let rawBefore = props.before
100
+ let initEmitBefore = true
100
101
 
101
102
  // 初始显示后置插槽
102
103
  let rawAfter = props.after
104
+ let initEmitAfter = true
103
105
 
104
106
  // 如果开启缓存
105
107
  if (props.cache) {
@@ -108,14 +110,15 @@ export default {
108
110
  cacheName = `splitter:${props.cache === true ? ($power && $power.routePath ? $power.routePath : utils.router.getRoute('path')) : props.cache}:`
109
111
 
110
112
  // 从缓存获取初始值
111
- let cache = utils.storage.get(cacheName + 'value')
113
+ let cache = utils.storage.get(cacheName + 'modelValue')
112
114
  if (cache !== null) {
113
115
  rawValue = cache
114
116
  }
115
117
 
116
- // 如果在手机模式
118
+ // 如果手机模式隐藏前置插槽
117
119
  if (props.hideBeforeInMobile && $q.platform.is.mobile) {
118
120
  rawBefore = false
121
+ initEmitBefore = false
119
122
 
120
123
  } else {
121
124
  // 从缓存获取初始值
@@ -125,11 +128,10 @@ export default {
125
128
  }
126
129
  }
127
130
 
128
- // 如果在手机模式
131
+ // 如果手机模式隐藏后置插槽
129
132
  if (props.hideAfterInMobile && $q.platform.is.mobile) {
130
133
  rawAfter = false
131
-
132
- console.log(777, rawAfter)
134
+ initEmitAfter = false
133
135
 
134
136
  } else {
135
137
  // 从缓存获取初始值
@@ -139,19 +141,19 @@ export default {
139
141
  }
140
142
  }
141
143
 
142
- console.log(222, rawAfter)
143
-
144
144
  // 如果在手机模式
145
145
  } else if ($q.platform.is.mobile) {
146
146
 
147
147
  // 手机模式隐藏前置插槽
148
148
  if (props.hideBeforeInMobile) {
149
149
  rawBefore = false
150
+ initEmitBefore = false
150
151
  }
151
152
 
152
- // 手机模式隐藏后插槽
153
+ // 手机模式隐藏后置插槽
153
154
  if (props.hideAfterInMobile) {
154
155
  rawAfter = false
156
+ initEmitAfter = false
155
157
  }
156
158
  }
157
159
 
@@ -160,14 +162,21 @@ export default {
160
162
 
161
163
  // 当前值
162
164
  const currentValue = ref(rawValue)
165
+ if (rawValue !== props.modelValue) {
166
+ emit('update:modelValue', rawValue)
167
+ }
163
168
 
164
169
  // 当前是否显示前置插槽
165
170
  const currentBefore = ref(rawBefore)
166
-
167
- console.log(333, rawAfter)
171
+ if (initEmitBefore) {
172
+ emit('update:before', rawBefore)
173
+ }
168
174
 
169
175
  // 当前是否显示后置插槽
170
176
  const currentAfter = ref(rawAfter)
177
+ if (initEmitAfter) {
178
+ emit('update:after', rawAfter)
179
+ }
171
180
 
172
181
  // ==========【计算属性】=========================================================================================
173
182
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"