Skip to content

Commit 38e4118

Browse files
committed
new version 1.0.10
1 parent df0162b commit 38e4118

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

packages/mpvue-template-compiler/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4404,7 +4404,7 @@ var attrs = {
44044404
});
44054405
} else if (key === 'v-html') {
44064406
ast.tag = 'rich-text';
4407-
attrs['nodes'] = '{{' + val + '}}';
4407+
attrs['nodes'] = "{{" + val + "}}";
44084408
} else if (key === 'v-show') {
44094409
attrs['hidden'] = "{{!(" + val + ")}}";
44104410
} else if (/^v\-on\:/i.test(key)) {

packages/mpvue-template-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpvue-template-compiler",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "mpvue template compiler for Vue",
55
"main": "index.js",
66
"repository": {

packages/mpvue/index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4144,7 +4144,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
41444144
});
41454145

41464146
Vue$3.version = '2.4.1';
4147-
Vue$3.mpvueVersion = '1.0.8';
4147+
Vue$3.mpvueVersion = '1.0.9';
41484148

41494149
/* globals renderer */
41504150

@@ -4939,7 +4939,7 @@ function patch () {
49394939

49404940
function callHook$1 (vm, hook, params) {
49414941
var handlers = vm.$options[hook];
4942-
if (hook === 'onError') {
4942+
if (hook === 'onError' && handlers) {
49434943
handlers = [handlers];
49444944
}
49454945

@@ -5007,7 +5007,7 @@ function initMP (mpType, next) {
50075007
},
50085008

50095009
handleProxy: function handleProxy (e) {
5010-
rootVueVM.$handleProxyWithVue(e);
5010+
return rootVueVM.$handleProxyWithVue(e)
50115011
},
50125012

50135013
// Do something initial when launch.
@@ -5048,7 +5048,7 @@ function initMP (mpType, next) {
50485048
},
50495049
methods: {
50505050
handleProxy: function handleProxy (e) {
5051-
rootVueVM.$handleProxyWithVue(e);
5051+
return rootVueVM.$handleProxyWithVue(e)
50525052
}
50535053
},
50545054
// mp lifecycle for vue
@@ -5093,7 +5093,7 @@ function initMP (mpType, next) {
50935093
},
50945094

50955095
handleProxy: function handleProxy (e) {
5096-
rootVueVM.$handleProxyWithVue(e);
5096+
return rootVueVM.$handleProxyWithVue(e)
50975097
},
50985098

50995099
// mp lifecycle for vue
@@ -5439,12 +5439,17 @@ function handleProxyWithVue (e) {
54395439
// https://developer.mozilla.org/zh-CN/docs/Web/API/Event
54405440
if (handles.length) {
54415441
var event = getWebEventByMP(e);
5442+
if (handles.length === 1) {
5443+
var result = handles[0](event);
5444+
return result
5445+
}
54425446
handles.forEach(function (h) { return h(event); });
54435447
} else {
5448+
// TODO, 在初始化时进行判断或直接使用 vue 本身的错误提示
54445449
var ref$1 = rootVueVM.$mp.page;
54455450
var route = ref$1.route;
54465451
console.group(new Date() + ' 事件警告');
5447-
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"));
5452+
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'"));
54485453
console.groupEnd();
54495454
}
54505455
}

packages/mpvue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpvue",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "Vue Runtime for mini program",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)