<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 官方axios在线地址 -->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<title>Document</title>
<!-- <script src="vue.js"></script> -->
<style>
.red {
color: red;
}
.fs {
font-size: 30px;
}
</style>
</head>
<body>
<div id="app">
<ul>
<li v-for="a in arr" :class="Classes()">{{a}}</li>
</ul>
</div>
<script>
var area = new Vue({
el: "#app",
data: {
arr: ["还望", "海尔兄弟", "火影忍者"],
isRED: true,
isFS: false
},
methods: {
Classes: function() {
return {
red: this.isRED,
fs: this.isFS
};
}
}
});
</script>
</body>
</html>