Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div id=id>
- <button @click="mb(1)">Bejár</button>
- {{ mj }}
- </div>
- </template>
- <script>
- let g=[
- [],
- [2,3],
- [4],
- [4,5],
- [],
- [],
- [5]
- ]
- export default {
- data: () => ({
- mj: Array(7).fill(false)
- }),
- methods: {
- mb(p) {
- this.$set(this.mj,p,true);
- g[p].forEach( v => {
- if (!this.mj[v]) {
- this.mb(v)
- }
- })
- }
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment