@mpxjs/webpack-plugin 2.9.72-beta.1 → 2.9.73-beta.1
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/lib/runtime/components/web/mpx-input.vue +14 -0
- package/lib/runtime/components/web/mpx-scroll-view.vue +1 -7
- package/lib/runtime/optionProcessor.js +2 -3
- package/lib/template-compiler/compiler.js +8 -1
- package/lib/web/processScript.js +1 -4
- package/lib/web/processTemplate.js +2 -4
- package/package.json +3 -4
|
@@ -56,6 +56,20 @@
|
|
|
56
56
|
if (val !== -1) this.setSelectionRange(undefined, val)
|
|
57
57
|
},
|
|
58
58
|
immediate: true
|
|
59
|
+
},
|
|
60
|
+
focus: {
|
|
61
|
+
handler (val) {
|
|
62
|
+
if (val) {
|
|
63
|
+
this.$nextTick(() => {
|
|
64
|
+
this.$refs.input.focus()
|
|
65
|
+
})
|
|
66
|
+
} else {
|
|
67
|
+
this.$nextTick(() => {
|
|
68
|
+
this.$refs.input.blur()
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
immediate: true
|
|
59
73
|
}
|
|
60
74
|
},
|
|
61
75
|
render (createElement) {
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
import PullDown from '@better-scroll/pull-down'
|
|
6
6
|
import throttle from 'lodash/throttle'
|
|
7
7
|
import debounce from 'lodash/debounce'
|
|
8
|
-
import MouseWheel from '@better-scroll/mouse-wheel'
|
|
9
8
|
|
|
10
9
|
BScroll.use(PullDown)
|
|
11
|
-
BScroll.use(MouseWheel)
|
|
12
10
|
|
|
13
11
|
let mutationObserver = null
|
|
14
12
|
let resizeObserver = null
|
|
@@ -215,11 +213,7 @@
|
|
|
215
213
|
bounce: false,
|
|
216
214
|
stopPropagation: true,
|
|
217
215
|
bindToWrapper: true,
|
|
218
|
-
eventPassthrough: (this.scrollX && 'vertical') || (this.scrollY && 'horizontal') || ''
|
|
219
|
-
mouseWheel: {
|
|
220
|
-
speed: 20,
|
|
221
|
-
easeTime: 300
|
|
222
|
-
}
|
|
216
|
+
eventPassthrough: (this.scrollX && 'vertical') || (this.scrollY && 'horizontal') || ''
|
|
223
217
|
}
|
|
224
218
|
if (this.refresherEnabled) {
|
|
225
219
|
originBsOptions.bounce = true
|
|
@@ -13,8 +13,7 @@ export function processComponentOption (
|
|
|
13
13
|
componentGenerics,
|
|
14
14
|
genericsInfo,
|
|
15
15
|
wxsMixin,
|
|
16
|
-
hasApp
|
|
17
|
-
disablePageTransition
|
|
16
|
+
hasApp
|
|
18
17
|
}
|
|
19
18
|
) {
|
|
20
19
|
// 局部注册页面和组件中依赖的组件
|
|
@@ -79,7 +78,7 @@ registered in parent context!`)
|
|
|
79
78
|
transitionName: ''
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
if (!disablePageTransition) {
|
|
81
|
+
if (!global.__mpx.config.webConfig.disablePageTransition) {
|
|
83
82
|
option.watch = {
|
|
84
83
|
$route: {
|
|
85
84
|
handler () {
|
|
@@ -720,7 +720,14 @@ function parse (template, options) {
|
|
|
720
720
|
currentParent.children.push(element)
|
|
721
721
|
element.parent = currentParent
|
|
722
722
|
processElement(element, root, options, meta)
|
|
723
|
+
|
|
723
724
|
tagNames.add(element.tag)
|
|
725
|
+
// 统计通过抽象节点方式使用的组件
|
|
726
|
+
element.attrsList.forEach((attr) => {
|
|
727
|
+
if (genericRE.test(attr.name)) {
|
|
728
|
+
tagNames.add(attr.value)
|
|
729
|
+
}
|
|
730
|
+
})
|
|
724
731
|
|
|
725
732
|
if (!unary) {
|
|
726
733
|
currentParent = element
|
|
@@ -2464,7 +2471,7 @@ function processShow (el, options, root) {
|
|
|
2464
2471
|
error$1(`Attrs ${config[mode].directive.show} should have a value `)
|
|
2465
2472
|
return
|
|
2466
2473
|
}
|
|
2467
|
-
if (ctorType === 'component' && el.parent === root && isRealNode(el)) {
|
|
2474
|
+
if (ctorType === 'component' && el.parent === root && isRealNode(el) && hasVirtualHost) {
|
|
2468
2475
|
show = has ? `{{${parseMustacheWithContext(show).result}&&mpxShow}}` : '{{mpxShow}}'
|
|
2469
2476
|
}
|
|
2470
2477
|
if (show === undefined) return
|
package/lib/web/processScript.js
CHANGED
|
@@ -26,8 +26,6 @@ module.exports = function (script, {
|
|
|
26
26
|
}, callback) {
|
|
27
27
|
const { projectRoot, appInfo, webConfig } = loaderContext.getMpx()
|
|
28
28
|
|
|
29
|
-
const { disablePageTransition = true } = webConfig
|
|
30
|
-
|
|
31
29
|
let output = '/* script */\n'
|
|
32
30
|
|
|
33
31
|
let scriptSrcMode = srcMode
|
|
@@ -84,8 +82,7 @@ module.exports = function (script, {
|
|
|
84
82
|
componentGenerics: ${JSON.stringify(componentGenerics)},
|
|
85
83
|
genericsInfo: ${JSON.stringify(genericsInfo)},
|
|
86
84
|
wxsMixin: getWxsMixin(wxsModules),
|
|
87
|
-
hasApp: ${hasApp}
|
|
88
|
-
disablePageTransition: ${JSON.stringify(disablePageTransition)},
|
|
85
|
+
hasApp: ${hasApp}
|
|
89
86
|
})\n`
|
|
90
87
|
return content
|
|
91
88
|
}
|
|
@@ -34,13 +34,11 @@ module.exports = function (template, {
|
|
|
34
34
|
let output = '/* template */\n'
|
|
35
35
|
|
|
36
36
|
if (ctorType === 'app') {
|
|
37
|
-
const { el
|
|
37
|
+
const { el } = webConfig
|
|
38
38
|
const idName = (el && el.match(/#(.*)/) && el.match(/#(.*)/)[1]) || 'app'
|
|
39
39
|
template = {
|
|
40
40
|
tag: 'template',
|
|
41
|
-
content:
|
|
42
|
-
? `<div id="${idName}"><mpx-keep-alive><router-view></router-view></mpx-keep-alive></div>`
|
|
43
|
-
: `<div id="${idName}"><transition :name="transitionName"><mpx-keep-alive><router-view></router-view></mpx-keep-alive></transition></div>`
|
|
41
|
+
content: `<div id="${idName}"><transition :name="transitionName"><mpx-keep-alive><router-view></router-view></mpx-keep-alive></transition></div>`
|
|
44
42
|
}
|
|
45
43
|
builtInComponentsMap['mpx-keep-alive'] = {
|
|
46
44
|
resource: addQuery('@mpxjs/webpack-plugin/lib/runtime/components/web/mpx-keep-alive.vue', { isComponent: true })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.73-beta.1",
|
|
4
4
|
"description": "mpx compile core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mpx"
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"@babel/traverse": "^7.16.0",
|
|
22
22
|
"@babel/types": "^7.16.0",
|
|
23
23
|
"@better-scroll/core": "^2.5.1",
|
|
24
|
-
"@better-scroll/mouse-wheel": "^2.5.1",
|
|
25
24
|
"@better-scroll/movable": "^2.5.1",
|
|
26
25
|
"@better-scroll/observe-dom": "^2.5.1",
|
|
27
26
|
"@better-scroll/pull-down": "^2.5.1",
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
"@better-scroll/wheel": "^2.5.1",
|
|
30
29
|
"@better-scroll/zoom": "^2.5.1",
|
|
31
30
|
"@mpxjs/template-engine": "^2.8.7",
|
|
32
|
-
"@mpxjs/utils": "^2.9.
|
|
31
|
+
"@mpxjs/utils": "^2.9.73",
|
|
33
32
|
"acorn": "^8.11.3",
|
|
34
33
|
"acorn-walk": "^7.2.0",
|
|
35
34
|
"async": "^2.6.0",
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
"devDependencies": {
|
|
85
84
|
"@ant-design/react-native": "^5.2.2",
|
|
86
85
|
"@d11/react-native-fast-image": "^8.6.12",
|
|
87
|
-
"@mpxjs/api-proxy": "^2.9.
|
|
86
|
+
"@mpxjs/api-proxy": "^2.9.73",
|
|
88
87
|
"@types/babel-traverse": "^6.25.4",
|
|
89
88
|
"@types/babel-types": "^7.0.4",
|
|
90
89
|
"@types/react": "^18.2.79",
|