blob: 64bc956cb24362100b6f2385d6b8096faa78f8b8 [file] [log] [blame]
<!--
* <template>: html-like syntax
* CSS-like inline style
* <style>: only support single-class selector
* <script>: define the behavior of component
* mustache-like data-binding support
* onxxx syntax to bind event with a component method
-->
<!--
notes:
* <template> only could have just one child
* the text node is only allowed as the child of <text> as the shorthand of its `value` attribute
* the style is not inherited from parent (for example: `font-size`)
* <script> support ECMAScript 5
* all component options assigns to `module.exports`
-->
<template>
<div class="wrapper" onclick="update">
<image src="{{logoUrl}}" class="logo"></image>
<text class="title">Hello {{target}}</text>
</div>
</template>
<style>
.wrapper {align-items: center; margin-top: 120px;}
.title {font-size: 48px;}
.logo {width: 360px; height: 82px;}
</style>
<script>
module.exports = {
data: {
logoUrl: 'https://alibaba.github.io/weex/img/weex_logo_blue@3x.png',
target: 'World'
},
methods: {
update: function (e) {
this.target = 'Weex'
}
}
}
</script>