Skip to content

Commit 3c7333d

Browse files
committed
feat:更改script setup
1 parent dcaf4b6 commit 3c7333d

File tree

4 files changed

+10
-37
lines changed

4 files changed

+10
-37
lines changed

src/views/home/Home.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,12 @@
1515
</div>
1616
</template>
1717

18-
<script>
18+
<script setup>
1919
import { ref } from 'vue'
2020
import { TABBAR_LIST } from '@/utils/enums'
2121
22-
export default {
23-
name: 'Home',
24-
setup () {
25-
const activeName = ref('home')
26-
const tabbarList = TABBAR_LIST
27-
return { activeName, tabbarList }
28-
}
29-
}
22+
const activeName = ref('home')
23+
const tabbarList = TABBAR_LIST
3024
</script>
3125

3226
<style lang="scss" scoped>

src/views/home/Mine.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
</template>
1818

19-
<script>
19+
<script setup>
2020
import { useStore } from 'vuex'
2121
import { useRouter } from 'vue-router'
2222
@@ -33,13 +33,7 @@ const mineEffect = () => {
3333
return { handleLogout, handleUserInfo }
3434
}
3535
36-
export default {
37-
name: 'Mine',
38-
setup () {
39-
const { handleLogout, handleUserInfo } = mineEffect()
40-
return { handleLogout, handleUserInfo }
41-
}
42-
}
36+
const { handleLogout, handleUserInfo } = mineEffect()
4337
</script>
4438

4539
<style lang="scss" scoped>

src/views/login/Login.vue

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</div>
3131
</template>
3232

33-
<script>
33+
<script setup>
3434
import { Toast } from 'vant'
3535
import { useStore } from 'vuex'
3636
import { useRouter } from 'vue-router'
@@ -65,19 +65,9 @@ const forgetEffect = () => {
6565
}
6666
return { handleForget }
6767
}
68-
export default {
69-
name: 'Login',
70-
setup () {
71-
const { username, password, handleLogin } = loginEffect()
72-
const { handleForget } = forgetEffect()
73-
return {
74-
username,
75-
password,
76-
handleLogin,
77-
handleForget
78-
}
79-
}
80-
}
68+
69+
const { username, password, handleLogin } = loginEffect()
70+
const { handleForget } = forgetEffect()
8171
</script>
8272

8373
<style lang="scss" scoped>

src/views/template.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
<div class="wrapper"></div>
33
</template>
44

5-
<script>
5+
<script setup>
66
// eslint-disable-next-line no-unused-vars
77
import { useStore } from 'vuex'
88
// eslint-disable-next-line no-unused-vars
99
import { ref, reactive, toRefs, computed, watch } from 'vue'
1010
// eslint-disable-next-line no-unused-vars
1111
import { useRoute, useRouter } from 'vue-router'
12-
export default {
13-
name: '',
14-
components: {},
15-
setup () {}
16-
}
1712
</script>
1813

1914
<style lang="scss">

0 commit comments

Comments
 (0)