以下是我的html代码请保留我的HTML代码中原有信息然后根据我的代码创建一个vuejs代码文件然后在我的代码中引用让我的网页更美观!DOCTYPE htmlhtmlhead meta http-equiv=Content-Type content=texthtml; charset=UTF-8 title对局环境title link rel=stylesheet type=textcss hre
在Vue.js中,我们可以将HTML代码作为模板,然后在Vue实例中使用这个模板来渲染页面。下面是根据你的HTML代码创建的Vue.js代码文件:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>对局环境</title>
<link rel="stylesheet" type="text/css" href="css/ys6.css">
<link rel="stylesheet" type="text/css" href="css/wztb.css">
</head>
<body>
<div id="app">
<nav id="nav">
<div>
<h1>
<a href="###" class="logo">王者荣耀</a>
</h1>
<ul>
<li><a href="gwsy.html">官网首页</a><em>HOME</em></li>
<li><a href="yxjs.html">游戏介绍</a><em>DATA</em></li>
<li><a href="yxgl.html">游戏攻略</a><em>STRATEGY</em></li>
<li><a href="wzyyt.html">王者音乐听</a><em>MUSIC</em></li>
<li><a href="yxbz.html">游戏壁纸</a><em>WALLPAPER</em></li>
<li><a href="djhj.html">对局环境</a><em>CONFRONTATION</em></li>
</ul>
</div>
</nav>
<header id="header">
<div class="zynr">
<div class="djhj1">
<div class="xyxt1" v-for="news in newsList">
<div class="xyxt1_bt1">
<span class="sj1">{{ news.date }}</span>
</div>
<div class="xyxt_nr1">
<div class="xyxt_wz1">
<p class="wz1">{{ news.title }}</p>
<p class="wz2">{{ news.subtitle1 }}</p>
<p class="wz2">{{ news.subtitle2 }}</p>
</div>
<a href="" class="wz3">查看更多</a>
</div>
</div>
</div>
<div class="djhj2">
<ul>
<li v-for="case in caseList">
<div :class="case.imageClass"></div>
<a href="" class="alzs1">{{ case.title }}</a>
<p class="alzs2">{{ case.description }}</p>
</li>
</ul>
</div>
<a href="" class="alzs3">更多经典案列</a>
</div>
</header>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
var app = new Vue({
el: "#app",
data: {
newsList: [
{
date: "2019.10.17",
title: "信誉系统界面升级",
subtitle1: "信誉系统新改版",
subtitle2: "等级奖励一目了然"
},
{
date: "2019.8.8",
title: "信誉积分规则优化",
subtitle1: "",
subtitle2: ""
},
{
date: "2019.1.9",
title: "信誉系统专属皮肤",
subtitle1: "",
subtitle2: ""
},
{
date: "2018.12.26",
title: "信誉积分上线分段奖励",
subtitle1: "",
subtitle2: ""
},
{
date: "2018.10.31",
title: "信誉系统全新改版解读",
subtitle1: "",
subtitle2: ""
}
],
caseList: [
{
imageClass: "tp1",
title: "案例展示",
description: "在队友打野过程中,推红蓝buff"
},
{
imageClass: "tp2",
title: "案例展示",
description: "冲到敌方防御塔下后完全不动的张飞"
},
{
imageClass: "tp3",
title: "案例展示",
description: "为什么我举报别人挂机,他只扣了一分?"
}
]
}
});
</script>
</body>
</html>
将以上代码保存为一个名为index.html的文件,然后通过浏览器打开该文件,你将看到使用Vue.js渲染的网页效果
原文地址: https://www.cveoy.top/t/topic/hFCk 著作权归作者所有。请勿转载和采集!