The weex builtin component ‘text’ is used to render text with specified style rule. tag can contain text value only. You can use variable interpolation in the text content with the mark {% raw %}{{}}{% endraw %}
.
This component supports no child components.
var textComponent = this.$el("textid"); this.text = textComponent.attr.value;
lines: specify the text lines. Default value is 0
for unlimited.
text styles: check out text styles
32
. Android: platform specify. HTML5: default value 32
.check out common styles for components
check out common events
<template> <div> <text>this is text content</text> <text value="this is text value"></text> <text style="text">{{price1}}</text> <text id="textid" onclick={{showtext}}>this is gettext content</text> <text value="{{text}}"></text> </div> </template> <style> .text { font-size: 24; text-decoration: underline; } </style> <script> module.exports = { data: { price1: '99.99', price2: '88.88', text:'' }, methods: { showtext: function(event) { var textComponent = this.$el("textid"); this.text = textComponent.attr.value; } } }; </script>