Skip to content

Commit d2237be

Browse files
committed
feat: turn on bg functions
1 parent e4ebad0 commit d2237be

File tree

1 file changed

+9
-45
lines changed

1 file changed

+9
-45
lines changed

src/views/Home.vue

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,15 @@
1-
<template>
2-
<div class="home">
3-
<img alt="Vue logo" src="../assets/logo.png" />
4-
<p>Count: {{ list }}</p>
5-
<p>New List: {{ newList }}</p>
6-
<button @click="list.push(5)">Add</button>
7-
<button @click="newList.push(4)">New Add</button>
8-
</div>
9-
</template>
10-
111
<script>
12-
import { reactive, ref, toRefs, watch } from 'vue'
2+
import BackgroundFunction from '../components/BackgroundFunction.vue'
133
144
export default {
15-
name: 'Home',
16-
setup() {
17-
const state = reactive({
18-
list: [1, 2, 3]
19-
})
20-
21-
const newList = ref([1, 2, 3])
22-
23-
watch(
24-
() => [...state.list],
25-
(currentValue, oldValue) => {
26-
console.log(currentValue)
27-
console.log(oldValue)
28-
}
29-
)
30-
31-
watch(
32-
() => [...newList.value],
33-
(currentValue, oldValue) => {
34-
console.log('new', currentValue)
35-
console.log('old', oldValue)
36-
}
37-
)
38-
39-
return {
40-
...toRefs(state),
41-
newList
42-
}
43-
},
44-
watch: {
45-
list(currentValue, oldValue) {
46-
console.log(currentValue)
47-
console.log(oldValue)
48-
}
5+
components: {
6+
BackgroundFunction
497
}
508
}
519
</script>
10+
11+
<template>
12+
<background-function />
13+
</template>
14+
15+
<style></style>

0 commit comments

Comments
 (0)