<view wx:for="{{users}}" wx:key="*this">{{item.name}}</view>
key值可以使用*this来表示
怎么做小程序视图层代码的拆分首先使用template声明一个模板
<template name="content-template">
<view>{{content}}</view>
<view>hello world</view>
</template>
再然后通过import src导入
<import src="./content.wxml" />
<view>header</view>
使用tamplate 声明模板的类型
<template is="content-template" data="{{content}}"/>
再然后是data里面声明变量
<view>footer</view>