Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebb325f

Browse files
committed
new version
1 parent e99ef87 commit ebb325f

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Vue.js in mini program",
55
"main": "dist/vue.runtime.common.js",
66
"module": "dist/vue.runtime.esm.js",
@@ -54,10 +54,10 @@
5454
"author": "anchengjian",
5555
"contributors": [
5656
{
57-
"name" : "hucq"
57+
"name": "hucq"
5858
},
5959
{
60-
"name" : "aOrz"
60+
"name": "aOrz"
6161
}
6262
],
6363
"license": "MIT",

packages/mpvue-template-compiler/build.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,16 @@ var camelize = cached(function (str) {
136136
*/
137137

138138

139-
139+
/**
140+
* Hyphenate a camelCase string.
141+
*/
142+
var hyphenateRE = /([^-])([A-Z])/g;
143+
var hyphenate = cached(function (str) {
144+
return str
145+
.replace(hyphenateRE, '$1-$2')
146+
.replace(hyphenateRE, '$1-$2')
147+
.toLowerCase()
148+
});
140149

141150
/**
142151
* Simple bind, faster than native
@@ -4124,6 +4133,7 @@ function mark (path, deps, iteratorArr) {
41244133
var iterator1 = path.iterator1;
41254134
var events = path.events;
41264135
var directives = path.directives;
4136+
var ifConditions = path.ifConditions;
41274137

41284138
var currentArr = Object.assign([], iteratorArr);
41294139

@@ -4141,10 +4151,19 @@ function mark (path, deps, iteratorArr) {
41414151
});
41424152
}
41434153

4154+
// fix: v-else events
4155+
if (ifConditions && ifConditions.length && !ifConditions._handled) {
4156+
ifConditions._handled = true;
4157+
ifConditions.forEach(function (v, i) {
4158+
mark(v.block, deps, currentArr);
4159+
});
4160+
}
4161+
41444162
// for mpvue-template-compiler
41454163
// events || v-model
41464164
var hasModel = directives && directives.find(function (v) { return v.name === 'model'; });
41474165
var needEventsID = events || hasModel;
4166+
41484167
if (needEventsID) {
41494168
var eventId = getWxEleId(deps.eventIndex, currentArr);
41504169
// const eventId = getWxEleId(eIndex, currentArr)
@@ -4600,17 +4619,17 @@ function convertAst (node, options, util) {
46004619

46014620
var children = node.children;
46024621
var ifConditions = node.ifConditions;
4603-
var tagName = node.tag;
46044622
var staticClass = node.staticClass; if ( staticClass === void 0 ) staticClass = '';
46054623
var mpcomid = node.mpcomid;
4624+
var tagName = node.tag;
46064625
var log = util.log;
46074626
var deps = util.deps;
46084627
var slots = util.slots;
46094628
var slotTemplates = util.slotTemplates;
46104629
var wxmlAst = Object.assign({}, node);
46114630
var moduleId = options.moduleId;
46124631
var components = options.components;
4613-
4632+
wxmlAst.tag = tagName = tagName ? hyphenate(tagName) : tagName;
46144633
// 引入 import, isSlot 是使用 slot 的编译地方,意即 <slot></slot> 的地方
46154634
var isSlot = tagName === 'slot';
46164635
if (isSlot) {

packages/mpvue-template-compiler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpvue-template-compiler",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "mpvue template compiler for Vue",
55
"main": "index.js",
66
"repository": {

packages/mpvue/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4144,7 +4144,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
41444144
}
41454145
});
41464146

4147-
Vue$3.version = '1.0.0';
4147+
Vue$3.version = '1.0.1';
41484148

41494149
/* globals renderer */
41504150

packages/mpvue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpvue",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Vue Runtime for mini program",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)