前言:最近公司要求写js,第一次用这个框架,就记录一下
一,我需要把后端传过来的数据(list集合),也就是金币+金额
2,导入js
<script src="js/template.js"></script>
3,页面,加粗是重点
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/root.css"/>
<script src="js/rem.js"></script>
<title>购买金币</title>
</head>
<body>
<div class="buy_head">
<img src="images/return.png" class="return" alt="" />
<div class="buy_head_title f36 tc">磁力云</div>
</div>
<div class="buy_tab">
<a href="buy_vip.html" class="buy_tab_main c99 f30">
会员
</a>
<a href="buy_coin.html" class="buy_tab_main c33 f38 ml50">
<span>金币</span>
<div class="buy_tab_main_b2"></div>
</a>
<a href="buy_space.html" class="buy_tab_main c99 f30 ml56">空间</a>
</div>
<img src="images/vip2.png" class="buy_vip_banner" alt="" />
<div class="buy_choice">
<script type="text/html" id="basic">
{
{each list as file i}}
<div class="buy_choice_main">
<div class="c66 f26 tc mt34 buy_pay_coin_head">{
{file.gold}}个</div>
<div class="mt24 buy_pay_coin left tc mt20 c0a">