vue.js模擬抽獎
這些都是老師上課講的,我只是做個記錄,感謝老師的付出
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<!--
關於這個中獎
客戶只看到1個界面
程序猿要設計兩個頁面
2個界面都在一個view裏面
-->
<div id="myview">
<div v-if="result>0.5">歐皇
<img src="${pageContext.request.contextPath}/img/0Y}Y]MO3IHHD0%O_FA0X1UQ.jpg">
</div>
<div v-else>非洲黑鬼
<img src="${pageContext.request.contextPath}/img/1.gif">
</div>
</div>
</body>
<script src="${pageContext.request.contextPath}/js/vue.js"></script>
<script type="text/javascript">
var model = {result:Math.random()};
var myviewmodel = new Vue({
el:‘#myview‘,
data:model
});
</script>
</html>
vue.js模擬抽獎