1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16{ 17 "@app-component/ifDirective": { 18 "_descriptor": {}, 19 "data": {}, 20 "template": { 21 "type": "div", 22 "attr": { 23 "debugLine": "pages/ifDirective/ifDirective:1" 24 }, 25 "children": [ 26 { 27 "type": "text", 28 "attr": { 29 "debugLine": "pages/ifDirective/ifDirective:3", 30 "value": "function () {return this.componentData.if}" 31 }, 32 "shown": "function () {return this.conditionVar===1}" 33 }, 34 { 35 "type": "div", 36 "attr": { 37 "className": "item-content", 38 "debugLine": "pages/ifDirective/ifDirective:6" 39 }, 40 "classList": [ 41 "item-content" 42 ], 43 "children": [ 44 { 45 "type": "text", 46 "attr": { 47 "debugLine": "pages/ifDirective/ifDirective:7", 48 "value": "function () {return this.componentData.if}" 49 }, 50 "shown": "function () {return this.conditionVar===1}" 51 }, 52 { 53 "type": "text", 54 "attr": { 55 "debugLine": "pages/ifDirective/ifDirective:8", 56 "value": "function () {return this.componentData.elif}" 57 }, 58 "shown": "function () {return this.conditionVar===2&&!(this.conditionVar===1)}" 59 }, 60 { 61 "type": "text", 62 "attr": { 63 "debugLine": "pages/ifDirective/ifDirective:9", 64 "value": "function () {return this.componentData.else}" 65 }, 66 "shown": "function () {return !(this.conditionVar===2)&&!(this.conditionVar===1)}" 67 } 68 ] 69 }, 70 { 71 "type": "div", 72 "attr": { 73 "debugLine": "pages/ifDirective/ifDirective:13" 74 }, 75 "shown": "function () {return this.showTest}", 76 "children": [ 77 { 78 "type": "div", 79 "attr": { 80 "debugLine": "pages/ifDirective/ifDirective:14" 81 }, 82 "repeat": "function () {return this.list}", 83 "children": [ 84 { 85 "type": "text", 86 "attr": { 87 "debugLine": "pages/ifDirective/ifDirective:15", 88 "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.$item.name)}" 89 } 90 } 91 ] 92 } 93 ] 94 }, 95 { 96 "type": "div", 97 "attr": { 98 "debugLine": "pages/ifDirective/ifDirective:20" 99 }, 100 "repeat": "function () {return this.list}", 101 "children": [ 102 { 103 "type": "div", 104 "attr": { 105 "debugLine": "pages/ifDirective/ifDirective:21" 106 }, 107 "shown": "function () {return !this.showTest}", 108 "children": [ 109 { 110 "type": "text", 111 "attr": { 112 "debugLine": "pages/ifDirective/ifDirective:22", 113 "value": "function () {return (this.$idx)+ decodeURI('') +decodeURI('.')+ decodeURI('') +(this.$item.name)}" 114 } 115 } 116 ] 117 } 118 ] 119 }, 120 { 121 "type": "div", 122 "attr": { 123 "debugLine": "pages/ifDirective/ifDirective:27" 124 }, 125 "repeat": { 126 "exp": "function () {return this.list}", 127 "key": "personIndex", 128 "value": "personItem" 129 }, 130 "children": [ 131 { 132 "type": "div", 133 "attr": { 134 "debugLine": "pages/ifDirective/ifDirective:28" 135 }, 136 "shown": "function () {return this.personIndex==1}", 137 "children": [ 138 { 139 "type": "text", 140 "attr": { 141 "debugLine": "pages/ifDirective/ifDirective:29", 142 "value": "function () {return this.personItem.name}" 143 } 144 } 145 ] 146 } 147 ] 148 }, 149 { 150 "type": "div", 151 "attr": { 152 "debugLine": "pages/ifDirective/ifDirective:34" 153 }, 154 "shown": "function () {return this.num1>this.num2?this.true_value:this.false_value}", 155 "children": [ 156 { 157 "type": "text", 158 "attr": { 159 "debugLine": "pages/ifDirective/ifDirective:35", 160 "value": "function () {return this.true_value}" 161 } 162 } 163 ] 164 } 165 ] 166 } 167 } 168 169}