File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export default {
51
51
} )
52
52
} else if ( key === 'v-html' ) {
53
53
ast . tag = 'rich-text'
54
- attrs [ 'nodes' ] = '{{' + val + '}}'
54
+ attrs [ 'nodes' ] = `{{ ${ val } }}`
55
55
} else if ( key === 'v-show' ) {
56
56
attrs [ 'hidden' ] = `{{!(${ val } )}}`
57
57
} else if ( / ^ v \- o n \: / i. test ( key ) ) {
Original file line number Diff line number Diff line change @@ -99,11 +99,16 @@ export function handleProxyWithVue (e) {
99
99
// https://developer.mozilla.org/zh-CN/docs/Web/API/Event
100
100
if ( handles . length ) {
101
101
const event = getWebEventByMP ( e )
102
+ if ( handles . length === 1 ) {
103
+ const result = handles [ 0 ] ( event )
104
+ return result
105
+ }
102
106
handles . forEach ( h => h ( event ) )
103
107
} else {
108
+ // TODO, 在初始化时进行判断或直接使用 vue 本身的错误提示
104
109
const { route } = rootVueVM . $mp . page
105
110
console . group ( new Date ( ) + ' 事件警告' )
106
- console . warn ( `Do not have handler in current page: ${ route } . Please make sure that handler has been defined in ${ route } , or ${ route } has been added into app.json ` )
111
+ console . warn ( `Do not have handler in current page: ${ route } . Please make sure that handler has been defined in ${ route } , or not use handler with 'v-if' ` )
107
112
console . groupEnd ( )
108
113
}
109
114
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { handleError } from '../../../core/util/index'
2
2
3
3
export function callHook ( vm , hook , params ) {
4
4
let handlers = vm . $options [ hook ]
5
- if ( hook === 'onError' ) {
5
+ if ( hook === 'onError' && handlers ) {
6
6
handlers = [ handlers ]
7
7
}
8
8
@@ -70,7 +70,7 @@ export function initMP (mpType, next) {
70
70
} ,
71
71
72
72
handleProxy ( e ) {
73
- rootVueVM . $handleProxyWithVue ( e )
73
+ return rootVueVM . $handleProxyWithVue ( e )
74
74
} ,
75
75
76
76
// Do something initial when launch.
@@ -107,7 +107,7 @@ export function initMP (mpType, next) {
107
107
} ,
108
108
methods : {
109
109
handleProxy ( e ) {
110
- rootVueVM . $handleProxyWithVue ( e )
110
+ return rootVueVM . $handleProxyWithVue ( e )
111
111
}
112
112
} ,
113
113
// mp lifecycle for vue
@@ -152,7 +152,7 @@ export function initMP (mpType, next) {
152
152
} ,
153
153
154
154
handleProxy ( e ) {
155
- rootVueVM . $handleProxyWithVue ( e )
155
+ return rootVueVM . $handleProxyWithVue ( e )
156
156
} ,
157
157
158
158
// mp lifecycle for vue
You can’t perform that action at this time.
0 commit comments