add main.css

pull/127/head
laoyang 3 years ago
parent a664651865
commit 24768237e2

@ -4,14 +4,16 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>Share</title> <title>Share</title>
<script src="./vue.js"></script> <script src="./vue.js"></script>
<link rel="stylesheet" href="./main.css" />
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<button @click="cl">{{ message }}</button> <button @click="cl">{{ message }}</button>
<p>Count is: {{ count }}</p> <p>Count is: {{ count }}</p>
</div> </div>
<div id="square"><div v-html="rawHtml">loading...</div></div>
<script> <script>
const { createApp, ref } = Vue const { createApp, ref, onMounted } = Vue
const app = createApp({ const app = createApp({
setup(){ setup(){
const message = ref('Hello Vue!') const message = ref('Hello Vue!')
@ -26,7 +28,25 @@
} }
} }
}) })
const square = createApp({
setup(){
let rawHtml = ''
let start = 0
for(let i = 1; i < 101; i++){
for(let j = 1; j < 101; j++){
start ++
rawHtml += `<div style="background:rgba(${i},${j},${Math.random()*255},.5)">${start}</div>`
}
}
return {
rawHtml
}
}
})
app.mount('#app') app.mount('#app')
square.mount('#square')
</script> </script>
</body> </body>
</html> </html>

@ -0,0 +1,13 @@
#square>div{
display: flex;
flex-wrap: wrap;
}
#square>div>div{
width: 100px;
height: 100px;
/* margin-right: 10px; */
/* margin-bottom: 10px; */
border: 1px solid #f1f1f1;
transform: rotate(1deg);
}
Loading…
Cancel
Save