小程序 import template 使用

2019-03-18  本文已影响0人  陶石子
  1. 在 item.wxml 中定义了一个叫item的template;


<template name="item">
<text>{{text}}</text>
</template>

  1. 在 index.wxml 中引用了 item.wxml,就可以使用item模板;

<import src="item.wxml"/>
<template is="item" data="{{text: 'forbar'}}"/>

上一篇 下一篇

猜你喜欢

热点阅读