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/class": { 18 "_descriptor": {}, 19 "data": {}, 20 "template": { 21 "type": "div", 22 "attr": { 23 "className": "container", 24 "debugLine": "pages/class/class:1" 25 }, 26 "classList": [ 27 "container" 28 ], 29 "children": [ 30 { 31 "type": "div", 32 "attr": { 33 "className": "title", 34 "debugLine": "pages/class/class:3", 35 "value": "class_test1" 36 }, 37 "classList": [ 38 "title" 39 ] 40 }, 41 { 42 "type": "div", 43 "attr": { 44 "className": "title table", 45 "debugLine": "pages/class/class:6", 46 "value": "class_test2" 47 }, 48 "classList": [ 49 "title", 50 "table" 51 ] 52 }, 53 { 54 "type": "div", 55 "attr": { 56 "className": "{{flag ? 'item' : 'item-selected'}}", 57 "debugLine": "pages/class/class:9", 58 "value": "class_test3" 59 }, 60 "classList": "function () {return [this.flag?'item':'item-selected']}" 61 }, 62 { 63 "type": "div", 64 "attr": { 65 "className": "{{a}} {{c}}", 66 "debugLine": "pages/class/class:12", 67 "value": "class_test4" 68 }, 69 "classList": "function () {return [this.a, this.c]}" 70 }, 71 { 72 "type": "div", 73 "attr": { 74 "className": "{{$idx}}{{d}} + {{$item.id}} aa", 75 "debugLine": "pages/class/class:15", 76 "value": "class_test5" 77 }, 78 "classList": "function () {return [this.$idx+this.d, '+', this.$item.id, 'aa']}" 79 } 80 ] 81 } 82 } 83}