<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>久久乘法表</title>
<style>
.a{
border: 1px solid black;
}
</style>
</head>
<body>
<div id="app">
<p v-for="item1 in arr">
<span v-for="item2 in arr" class="a" v-show="item1>=item2">
<!-- 遍历 -->
{{item2}}*{{item1}}={{item1*item2}}
<!-- 添加空格 纯粹是为了美观点 -->
</span>
</p>
</div>
<script src=" https://cdn.staticfile.org/vue/3.0.5/vue.global.js"></script>
<script>
const app = {
data() {
return {
arr:[1,2,3,4,5,6,7,8,9]
// 对象数组,对象中有变量text
}
}
}
Vue.createApp(app).mount('#app')
</script>
</body>
</html>