- Notifications
You must be signed in to change notification settings - Fork 4.1k
/
Copy pathHeavy.vue
42 lines (40 loc) · 619 Bytes
/
Heavy.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script>
exportdefault {
props: {
n: {
default:1000000,
},
},
computed: {
size() {
return20+this.n/9999999*40
},
},
methods: {
heavy() {
constn=this.n
let result =0
for (let i =0; i < n; i++) {
result +=Math.tan(Math.sqrt(Math.cos(Math.sin(Math.random() *100))))
}
return result
},
},
}
</script>
<template>
<div
class="heavy"
:style="{
width: `${size}px`,
height: `${size}px`,
}"
>
<pre>{{ heavy() }}</pre>
</div>
</template>
<style scoped>
.heavy {
background: red;
}
</style>