File size: 619 Bytes
4d70170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
<script>
export default {
  props: {
    n: {
      default: 1000000,
    },
  },
  computed: {
    size() {
      return 20 + this.n / 9999999 * 40
    },
  },
  methods: {
    heavy() {
      const n = 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>