| OLD | NEW |
| (Empty) |
| 1 #!mojo mojo:sky_viewer | |
| 2 <!-- | |
| 3 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 4 // Use of this source code is governed by a BSD-style license that can be | |
| 5 // found in the LICENSE file. | |
| 6 --> | |
| 7 <sky> | |
| 8 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> | |
| 9 <import src="/sky/framework/sky-scrollable.sky" /> | |
| 10 <import src="data/cities.sky" as="cities" /> | |
| 11 | |
| 12 <sky-element name="example-scrollable"> | |
| 13 <template> | |
| 14 <style> | |
| 15 sky-scrollable { | |
| 16 margin: 20px; | |
| 17 height: 400px; | |
| 18 border: 2px solid blue; | |
| 19 } | |
| 20 b { | |
| 21 display: inline; | |
| 22 font-weight: bold; | |
| 23 } | |
| 24 </style> | |
| 25 <sky-scrollable> | |
| 26 <template repeat="{{ cities }}"> | |
| 27 <template> | |
| 28 <div>{{ name }}</div> | |
| 29 </template> | |
| 30 </template> | |
| 31 </sky-scrollable> | |
| 32 </template> | |
| 33 <script> | |
| 34 module.exports = class extends SkyElement { | |
| 35 created() { | |
| 36 this.cities = cities.slice(0, 300); | |
| 37 } | |
| 38 }.register(); | |
| 39 </script> | |
| 40 </sky-element> | |
| 41 | |
| 42 <example-scrollable /> | |
| 43 </sky> | |
| OLD | NEW |