mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

After this CL, you can use <sky-element> to describe custom elements. The current iteration is very basic and is hardcoded to "example", but its a start. This CL renames the |init| function to |_init| to prevent importers from calling it directly. Also, we now pass the <script> element to |_init| to give some context. R=ojan@chromium.org, eseidel@chromium.org Review URL: https://codereview.chromium.org/950493003
26 lines
532 B
Plaintext
26 lines
532 B
Plaintext
<!--
|
|
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
-->
|
|
<import src="/sky/framework/sky-element.sky" />
|
|
<sky-element>
|
|
<template>
|
|
<style>
|
|
div {
|
|
height: 50px;
|
|
width: 50px;
|
|
background-color: green;
|
|
}
|
|
</style>
|
|
<div>Hi</div>
|
|
</template>
|
|
<script>
|
|
@Tagname('example')
|
|
class ExampleElement extends SkyElement {
|
|
}
|
|
|
|
_init(script) => register(script, ExampleElement);
|
|
</script>
|
|
</sky-element>
|