多语言展示
当前在线:1007今日阅读:155今日分享:35

template模板提高小程序编写代码效率

template模板编写的越细越好,在编写小程序代码很多模块都是重复出现的,而通过template则可以使代码更加简单美观
工具/原料

template

方法/步骤
1

先创建一个文件夹index-template   index-template.wxml   index-template.wxss在index-template.wxml里面编写模板的需要的标签在 index-template.wxss里面编写模板的样式 view{height:60rpx;width:60rpx;}.header{font-size:18px;font-weight:blod;}

2

那么如何将template里面的内容引入到其他的wxml呢?那就是小编接下要说的假如需要将template引入到index.wxmlindex.wxml     //引入模板的路径