File tree Expand file tree Collapse file tree 7 files changed +27
-55
lines changed
Expand file tree Collapse file tree 7 files changed +27
-55
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ module.exports = {
2222 'import/no-named-as-default-member' : 'off' ,
2323 'import/no-unresolved' : 'off' ,
2424 '@typescript-eslint/consistent-type-imports' : 'off' ,
25+ '@typescript-eslint/no-unused-vars' : 'off' ,
2526 // enUS: all rules docs https://eslint.org/docs/rules/
2627 // zhCN: 所有规则文档 https://eslint.bootcss.com/docs/rules/
2728 // 基础规则 全部 ES 项目通用
Original file line number Diff line number Diff line change 55{{ /if }}
66
77{{ #if script }}
8- <script lang =" ts" >
9- import { defineComponent } from ' vue'
10-
11- export default defineComponent ({
12- name: ' {{ properCase name }}' ,
13- })
8+ <script setup lang =" ts" >
149</script >
1510{{ /if }}
1611
Original file line number Diff line number Diff line change 55{{ /if }}
66
77{{ #if script }}
8- <script lang =" ts" >
9- import { defineComponent } from ' vue'
10-
11- export default defineComponent ({
12- name: ' {{ properCase name }}' ,
13- })
8+ <script setup lang =" ts" >
149</script >
1510{{ /if }}
1611
Original file line number Diff line number Diff line change 55 </van-config-provider >
66</template >
77
8- <script lang="ts">
9- import { defineComponent , ref , watch } from ' vue'
8+ <script setup lang="ts">
9+ import { ref , watch } from ' vue'
1010import type { ConfigProviderTheme } from ' vant'
11- export default defineComponent ({
12- setup() {
13- const theme = ref <ConfigProviderTheme >(' light' )
14- const checked = ref <boolean >(false )
1511
16- watch (checked ,() => {
17- if (checked .value ) {
18- theme .value = ' dark'
19- document .getElementsByTagName (' html' )[0 ].setAttribute (' data-theme' , ' data-theme-dark' )
20- } else {
21- theme .value = ' light'
22- document .getElementsByTagName (' html' )[0 ].setAttribute (' data-theme' , ' data-theme-light' )
23- }
24- })
25-
26- return {
27- theme ,
28- checked
29- }
12+ const theme = ref <ConfigProviderTheme >(' light' )
13+ const checked = ref <boolean >(false )
14+
15+ watch (checked ,() => {
16+ if (checked .value ) {
17+ theme .value = ' dark'
18+ document .querySelector (' html' )
19+ .setAttribute (' data-theme' , ' data-theme-dark' )
20+ } else {
21+ theme .value = ' light'
22+ document .querySelector (' html' )
23+ .setAttribute (' data-theme' , ' data-theme-light' )
3024 }
3125})
3226 </script >
Original file line number Diff line number Diff line change 55 </div >
66</template >
77
8- <script lang="ts">
9- import { defineComponent } from ' vue'
10- export default defineComponent ({
11- setup() {
12- return {}
13- }
14- })
15- </script >
16-
178<style lang="less" scoped>
189.container {
1910 width : 100vw ;
Original file line number Diff line number Diff line change 44 </div >
55</template >
66
7- <script lang="ts">
8- import { defineComponent } from ' vue'
7+ <script setup lang="ts">
98import { useFetchData } from ' @/utils/hooks/useFetchData'
109import { queryProjectNotice } from ' @/api/dashboard/workplace'
11- export default defineComponent ({
12- setup() {
13- const { context : projects } = useFetchData (() => {
14- return queryProjectNotice ().then (res => {
15- return {
16- data: res
17- }
18- })
19- })
2010
11+ const { context : projects } = useFetchData (() => {
12+ return queryProjectNotice ().then (res => {
2113 return {
22- projects
14+ data: res
2315 }
24- }
16+ })
2517})
2618
2719 </script >
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ export default ({ mode }: ConfigEnv): UserConfig => {
1717 'process.env.VUE_APP_PUBLIC_PATH' : JSON . stringify ( env . VITE_APP_PUBLIC_PATH ) ,
1818 } ,
1919 plugins : [
20- vue ( ) ,
20+ vue ( {
21+ // Reactivity transform is an experimental feature.
22+ // https://github.com/vuejs/rfcs/discussions/369.
23+ // reactivityTransform: true
24+ } ) ,
2125 Components ( {
2226 dts : true ,
2327 resolvers : [ VantResolver ( ) ] ,
You can’t perform that action at this time.
0 commit comments