diff --git a/ace-loader/test/lite/expected/forDirective.js b/ace-loader/test/lite/expected/forDirective.js index c7f4c57..a6b2baa 100644 --- a/ace-loader/test/lite/expected/forDirective.js +++ b/ace-loader/test/lite/expected/forDirective.js @@ -13,4 +13,4 @@ * limitations under the License. */ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($item,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )}),_c('div', [_l((function () {return _vm.list}),function(personItem,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($idx,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('-') + (personItem.name) + decodeURI('--') + (personItem.age)}}} )] )}),_c('image', {'attrs' : {'src' : function () {return _vm.personItem}}} )] ),_c('div', [_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}}} )] )}),_c('swiper', {'attrs' : {'index' : function () {return _vm.personIndex},'loop' : function () {return _vm.personItem}}} )] ),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return _vm.menu}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (personItem.id) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return personItem}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (index) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}},'onBubbleEvents' : {'click' : personItem.click}} )] )}),_l((function () {return value.list}),function(index,value){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(value,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return value.info}},'onBubbleEvents' : {'click' : value.click}} )] )})] ) }"} \ No newline at end of file +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($item,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +($item.name)}}} )] )}),_c('div', [_l((function () {return _vm.list}),function(personItem,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($idx,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx)+ decodeURI('') +decodeURI('-')+ decodeURI('') +(personItem.name)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(personItem.age)}}} )] )}),_c('image', {'attrs' : {'src' : function () {return _vm.personItem}}} )] ),_c('div', [_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return (personIndex)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(personItem.name)}}} )] )}),_c('swiper', {'attrs' : {'index' : function () {return _vm.personIndex},'loop' : function () {return _vm.personItem}}} )] ),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return _vm.menu}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (personItem.id)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return personItem}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (index)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return (personIndex)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(personItem.name)}},'onBubbleEvents' : {'click' : personItem.click}} )] )}),_l((function () {return value.list}),function(index,value){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(value,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return value.info}},'onBubbleEvents' : {'click' : value.click}} )] )})] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/ifDirective.js b/ace-loader/test/lite/expected/ifDirective.js index 3966b83..ea422cd 100644 --- a/ace-loader/test/lite/expected/ifDirective.js +++ b/ace-loader/test/lite/expected/ifDirective.js @@ -13,4 +13,4 @@ * limitations under the License. */ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_c('div', {'staticClass' : [\"item-content\"]} , [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_i((function () {return _vm.conditionVar===2&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.elif}}} )}),_i((function () {return !(_vm.conditionVar===2)&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.else}}} )})] ),_i((function () {return _vm.showTest}),function(){return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_i((function () {return _vm.showTest}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', [_i((function () {return personIndex==1}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return personItem.name}}} )] )})] )})] ) }"} \ No newline at end of file +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_c('div', {'staticClass' : [\"item-content\"]} , [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_i((function () {return _vm.conditionVar===2&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.elif}}} )}),_i((function () {return !(_vm.conditionVar===2)&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.else}}} )})] ),_i((function () {return _vm.showTest}),function(){return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_i((function () {return _vm.showTest}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', [_i((function () {return personIndex==1}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return personItem.name}}} )] )})] )})] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/sick.js b/ace-loader/test/lite/expected/sick.js index 8afba09..21ab7ae 100644 --- a/ace-loader/test/lite/expected/sick.js +++ b/ace-loader/test/lite/expected/sick.js @@ -19,7 +19,7 @@ "dizzinessColor": "#F5B041", "marginLeft": "77px" }, - "render": "function (vm) { var _vm = vm || this; var i18ns = []; i18ns.push( _vm.$t('strings.choose_body_state') );i18ns.push( _vm.$t('css.measureHome_hand_top') );i18ns.push( _vm.$t('strings.chest_tightness') );i18ns.push( _vm.$t('css.judgeIos_height') );i18ns.push( _vm.$t('strings.dizziness') );i18ns.push( (i18ns[4]) + decodeURI('%20:%E5%A4%B4%E7%97%9B') );i18ns.push( (i18ns[2]) + decodeURI('%20+%20') + (i18ns[4]) ); return _c('list', {'attrs' : {'ref' : \"list\"},'staticClass' : [\"container\"],'onBubbleEvents' : {'swipe' : _vm.touchMove}} , [_c('list-item', {'staticClass' : [\"head_t\"]} , [_c('text', {'attrs' : {'value' : i18ns[0]},'staticClass' : [\"head_t_b\"],'staticStyle' : {'marginTop' : i18ns[1],'color' : 16711680}, 'dynamicStyle' :{'marginLeft' : function () {return _vm.marginLeft}}} )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[2]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[4]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, 'dynamicStyle' :{'color' : function () {return _vm.dizzinessColor}}} )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[5]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[6]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"buttonContainerStyle\"]} , [_c('input', {'attrs' : {'type' : \"button\",'value' : \"下一页\"},'staticClass' : [\"buttonStyle\"],'onBubbleEvents' : {'click' : _vm.change}} )] )] ) }", + "render": "function (vm) { var _vm = vm || this; var i18ns = []; i18ns.push( _vm.$t('strings.choose_body_state') );i18ns.push( _vm.$t('css.measureHome_hand_top') );i18ns.push( _vm.$t('strings.chest_tightness') );i18ns.push( _vm.$t('css.judgeIos_height') );i18ns.push( _vm.$t('strings.dizziness') );i18ns.push( (i18ns[4])+ decodeURI('') +decodeURI('%20:%E5%A4%B4%E7%97%9B') );i18ns.push( (i18ns[2])+ decodeURI('') +decodeURI('%20+%20')+ decodeURI('') +(i18ns[4]) ); return _c('list', {'attrs' : {'ref' : \"list\"},'staticClass' : [\"container\"],'onBubbleEvents' : {'swipe' : _vm.touchMove}} , [_c('list-item', {'staticClass' : [\"head_t\"]} , [_c('text', {'attrs' : {'value' : i18ns[0]},'staticClass' : [\"head_t_b\"],'staticStyle' : {'marginTop' : i18ns[1],'color' : 16711680}, 'dynamicStyle' :{'marginLeft' : function () {return _vm.marginLeft}}} )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[2]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[4]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, 'dynamicStyle' :{'color' : function () {return _vm.dizzinessColor}}} )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[5]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"list\"]} , [_c('text', {'attrs' : {'value' : i18ns[6]},'staticClass' : [\"listL\"],'staticStyle' : {'width' : i18ns[3]}, } )] ),_c('list-item', {'staticClass' : [\"buttonContainerStyle\"]} , [_c('input', {'attrs' : {'type' : \"button\",'value' : \"下一页\"},'staticClass' : [\"buttonStyle\"],'onBubbleEvents' : {'click' : _vm.change}} )] )] ) }", "styleSheet": { "classSelectors": { "buttonContainerStyle": { diff --git a/ace-loader/test/rich/expected/expression.js b/ace-loader/test/rich/expected/expression.js index 245e1e5..69375ed 100644 --- a/ace-loader/test/rich/expected/expression.js +++ b/ace-loader/test/rich/expected/expression.js @@ -318,7 +318,7 @@ "className": "text_large", "debugLine": "pages/expression/expression:59", "tid": "id", - "value": "function () {return (this.$idx) + decodeURI('+') + (this.$item.id)}" + "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('+')+ decodeURI('') +(this.$item.id)}" }, "classList": [ "text_large" diff --git a/ace-loader/test/rich/expected/forDirective.js b/ace-loader/test/rich/expected/forDirective.js index 669c040..41bb5a1 100644 --- a/ace-loader/test/rich/expected/forDirective.js +++ b/ace-loader/test/rich/expected/forDirective.js @@ -37,7 +37,7 @@ "type": "text", "attr": { "debugLine": "pages/forDirective/forDirective:4", - "value": "function () {return (this.$idx) + decodeURI('.') + (this.$item.name)}" + "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.$item.name)}" } } ] @@ -65,7 +65,7 @@ "type": "text", "attr": { "debugLine": "pages/forDirective/forDirective:10", - "value": "function () {return (this.$idx) + decodeURI('-') + (this.personItem.name) + decodeURI('--') + (this.personItem.age)}" + "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('-')+ decodeURI('') +(this.personItem.name)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(this.personItem.age)}" } } ] @@ -105,7 +105,7 @@ "type": "text", "attr": { "debugLine": "pages/forDirective/forDirective:18", - "value": "function () {return (this.personIndex) + decodeURI('.') + (this.personItem.name)}" + "value": "function () {return (this.personIndex)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.personItem.name)}" } } ] @@ -133,7 +133,7 @@ { "attr": { "debugLine": "pages/forDirective/forDirective:26", - "value": "function () {return (this.personItem.id) + decodeURI('--') + (this.item.name)}" + "value": "function () {return (this.personItem.id)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(this.item.name)}" }, "type": "text" } @@ -169,7 +169,7 @@ { "attr": { "debugLine": "pages/forDirective/forDirective:33", - "value": "function () {return (this.index) + decodeURI('--') + (this.item.name)}" + "value": "function () {return (this.index)+ decodeURI('') +decodeURI('--')+ decodeURI('') +(this.item.name)}" }, "type": "text" } @@ -200,7 +200,7 @@ { "attr": { "debugLine": "pages/forDirective/forDirective:40", - "value": "function () {return (this.personIndex) + decodeURI('.') + (this.personItem.name)}" + "value": "function () {return (this.personIndex)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.personItem.name)}" }, "events": { "click": "personItem.click" diff --git a/ace-loader/test/rich/expected/ifDirective.js b/ace-loader/test/rich/expected/ifDirective.js index 035d414..5903803 100644 --- a/ace-loader/test/rich/expected/ifDirective.js +++ b/ace-loader/test/rich/expected/ifDirective.js @@ -85,7 +85,7 @@ "type": "text", "attr": { "debugLine": "pages/ifDirective/ifDirective:15", - "value": "function () {return (this.$idx) + decodeURI('.') + (this.$item.name)}" + "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.$item.name)}" } } ] @@ -110,7 +110,7 @@ "type": "text", "attr": { "debugLine": "pages/ifDirective/ifDirective:22", - "value": "function () {return (this.$idx) + decodeURI('.') + (this.$item.name)}" + "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.$item.name)}" } } ] diff --git a/ace-loader/test/rich/test.js b/ace-loader/test/rich/test.js index 7d86d42..c9dfe48 100644 --- a/ace-loader/test/rich/test.js +++ b/ace-loader/test/rich/test.js @@ -34,7 +34,7 @@ function getActualString(componentName) { function getExpectJSON(componentName) { const matchHashComment = /\/\*(.|\n)+\*\//; const filepath = path.join(__dirname, 'expected', `${componentName}.js`); - const expectedContent = fs.readFileSync(filepath, 'utf-8'); + const expectedContent = fs.readFileSync(filepath, 'utf-8').substring(620); const expectedObj = JSON.parse(expectedContent.toString().replace(matchHashComment, '')); return expectedObj; }