@mpxjs/webpack-plugin 2.6.114-alpha.2 → 2.6.114-alpha.5

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.
@@ -237,6 +237,10 @@ module.exports = function getSpec ({ warn, error }) {
237
237
  name: 'mpxModelEvent',
238
238
  value: modelEvent
239
239
  },
240
+ {
241
+ name: 'mpxModelEventId',
242
+ value: Math.random().toString(36).substr(3, 8)
243
+ },
240
244
  {
241
245
  name: '@mpxModel',
242
246
  value: `__model(${stringifyWithResolveComputed(modelValue)}, $event, ${stringify(modelValuePathArr)}, ${stringify(modelFilter)})`
@@ -87,11 +87,20 @@ function processModel (listeners, context) {
87
87
  // todo 访问$listeners也会导致上述现象,但是为了事件代理还必须访问$listeners,待后续思考处理
88
88
 
89
89
  const modelEvent = context.$attrs.mpxModelEvent
90
- if (modelEvent) {
90
+ const modelEventId = context.$attrs.mpxModelEventId
91
+ if (modelEvent && modelEventId) {
91
92
  // 对于modelEvent,内部获得时间后向外部转发,触发外部listener的同时转发为mpxModel事件
92
- listeners[modelEvent] = function (e) {
93
- context.$emit(modelEvent, e)
94
- context.$emit('mpxModel', e)
93
+
94
+ const listener = listeners['onInput']
95
+
96
+ listeners['onInput'] = function (e) {
97
+ Hummer.notifyCenter.triggerEvent(modelEventId, {
98
+ detail: e
99
+ })
100
+ context.$emit('mpxModel', {
101
+ detail: e
102
+ })
103
+ listener && listener.call(this, e)
95
104
  }
96
105
  // 内部listener不需要mpxModel
97
106
  delete listeners.mpxModel
@@ -150,7 +150,7 @@ export default (function(){
150
150
 
151
151
 
152
152
 
153
- <style lang="stylus">
153
+ <style lang="stylus" scoped>
154
154
  .mpx-button-versionv2
155
155
  width: 184px
156
156
  line-height 1.41176471
@@ -53,7 +53,7 @@ export default {
53
53
  },
54
54
  };
55
55
  </script>
56
- <style lang="stylus">
56
+ <style lang="stylus" scoped>
57
57
  .mpx-image
58
58
  width 300px
59
59
  height 225px
@@ -83,7 +83,7 @@ export default {
83
83
  methods: {},
84
84
  };
85
85
  </script>
86
- <style lang="stylus">
86
+ <style lang="stylus" scoped>
87
87
  .mpx-input
88
88
  cursor auto
89
89
  width 100%
@@ -80,7 +80,7 @@ export default {
80
80
  };
81
81
  </script>
82
82
 
83
- <style lang="stylus">
83
+ <style lang="stylus" scoped>
84
84
  .mpx-switch-wrap
85
85
  .mpx-switch-label
86
86
  border-radius 16hm
@@ -51,7 +51,7 @@ export default {
51
51
  methods: {},
52
52
  };
53
53
  </script>
54
- <style lang="stylus">
54
+ <style lang="stylus" scoped>
55
55
  .mpx-textarea
56
56
  font inherit
57
57
  cursor auto
@@ -55,7 +55,7 @@ export default {
55
55
  },
56
56
  };
57
57
  </script>
58
- <style lang="stylus">
58
+ <style lang="stylus" scoped>
59
59
  .mpx-text
60
60
  user-select none
61
61
  &.selectable
@@ -29,7 +29,7 @@ module.exports = function (css, map) {
29
29
 
30
30
  const transRpxRules = transRpxRulesRaw ? (Array.isArray(transRpxRulesRaw) ? transRpxRulesRaw : [transRpxRulesRaw]) : []
31
31
 
32
- const transRpxFn = mpx.webConfig.transRpxFn
32
+ const transRpxFn = mpx.webConfig && mpx.webConfig.transRpxFn
33
33
  const testResolveRange = (include = () => true, exclude) => {
34
34
  return matchCondition(this.resourcePath, { include, exclude })
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.6.114-alpha.2",
3
+ "version": "2.6.114-alpha.5",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -85,5 +85,5 @@
85
85
  "@types/babel-types": "^7.0.4",
86
86
  "webpack": "^4.46.0"
87
87
  },
88
- "gitHead": "9cda3088af3571ce1101bd3dc318b7ed8853ee26"
88
+ "gitHead": "19cd16b7d2fd80e292b74689fcb5b2529f0504e6"
89
89
  }