Skip to content

Commit cec3ec9

Browse files
committed
Style(methods): remove vue-property-decorator methods for better support with vetur
1 parent 439ecec commit cec3ec9

File tree

16 files changed

+38
-41
lines changed

16 files changed

+38
-41
lines changed

src/components/DraggableKanban/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
3131
})
3232
export default class extends Vue {
3333
@Prop({ default: 'header' }) private headerText!: string
34-
@Prop({ default: () => [] }) private list!: object[]
34+
@Prop({ default: () => [] }) private list!: any[]
3535
@Prop({ default: () => {} }) private options!: object
3636
}
3737
</script>

src/components/DropdownMenu/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@click.self="clickTitle"
1010
>{{ title }}</span>
1111
<div
12-
v-for="(item,index) of items"
12+
v-for="(item, index) of items"
1313
:key="index"
1414
class="share-dropdown-menu-item"
1515
>
@@ -31,7 +31,7 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
3131
name: 'DropdownMenu'
3232
})
3333
export default class extends Vue {
34-
@Prop({ default: () => [] }) private items!: object[]
34+
@Prop({ default: () => [] }) private items!: any[]
3535
@Prop({ default: 'vue' }) private title!: string
3636
3737
private isActive = false

src/components/HeaderSearch/index.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
v-for="item in options"
2525
:key="item.path"
2626
:value="item"
27-
:label="item.title.join(' > ')"
27+
:label="item.meta.title.join(' > ')"
2828
/>
2929
</el-select>
3030
</div>
@@ -136,15 +136,17 @@ export default class extends Vue {
136136
continue
137137
}
138138
139-
const data = {
139+
const data: RouteConfig = {
140140
path: path.resolve(basePath, router.path),
141-
title: [...prefixTitle]
141+
meta: {
142+
title: [...prefixTitle]
143+
}
142144
}
143145
144146
if (router.meta && router.meta.title) {
145147
// generate internationalized title
146148
const i18ntitle = i18n.t(`route.${router.meta.title}`).toString()
147-
data.title = [...data.title, i18ntitle]
149+
data.meta.title = [...data.meta.title, i18ntitle]
148150
if (router.redirect !== 'noRedirect') {
149151
// only push the routes with title
150152
// special case: need to exclude parent router without redirect
@@ -154,7 +156,7 @@ export default class extends Vue {
154156
155157
// recursive child routes
156158
if (router.children) {
157-
const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
159+
const tempRoutes = this.generateRoutes(router.children, data.path, data.meta.title)
158160
if (tempRoutes.length >= 1) {
159161
res = [...res, ...tempRoutes]
160162
}

src/components/PanThumb/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
:style="{zIndex: zIndex,height: height,width: width}"
3+
:style="{zIndex: zIndex, height: height, width: width}"
44
class="pan-item"
55
>
66
<div class="pan-info">

src/layout/components/Sidebar/SidebarItem.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@
3838
slot="title"
3939
>{{ $t('route.' + item.meta.title) }}</span>
4040
</template>
41-
<sidebar-item
42-
v-for="child in item.children"
43-
:key="child.path"
44-
:item="child"
45-
:is-collapse="isCollapse"
46-
:is-first-level="false"
47-
:base-path="resolvePath(child.path)"
48-
class="nest-menu"
49-
/>
41+
<template v-if="item.children">
42+
<sidebar-item
43+
v-for="child in item.children"
44+
:key="child.path"
45+
:item="child"
46+
:is-collapse="isCollapse"
47+
:is-first-level="false"
48+
:base-path="resolvePath(child.path)"
49+
class="nest-menu"
50+
/>
51+
</template>
5052
</el-submenu>
5153
</div>
5254
</template>

src/layout/components/Sidebar/SidebarItemLink.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
2020
import { isExternal } from '@/utils/validate'
2121
2222
@Component({
23-
name: 'SidebarItemLink',
24-
methods: {
25-
isExternal
26-
}
23+
name: 'SidebarItemLink'
2724
})
2825
export default class extends Vue {
2926
@Prop({ required: true }) private to!: string
27+
28+
private isExternal = isExternal
3029
}
3130
</script>

src/layout/components/TagsView/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</scroll-pane>
2929
<ul
3030
v-show="visible"
31-
:style="{left: left+'px',top: top+'px'}"
31+
:style="{left: left+'px', top: top+'px'}"
3232
class="contextmenu"
3333
>
3434
<li @click="refreshSelectedTag(selectedTag)">

src/views/clipboard/index.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ import { Component, Vue } from 'vue-property-decorator'
4545
import { handleClipboard, clipboardSuccess } from '@/utils/clipboard' // use clipboard directly
4646
4747
@Component({
48-
name: 'Clipboard',
49-
methods: {
50-
handleClipboard,
51-
clipboardSuccess
52-
}
48+
name: 'Clipboard'
5349
})
5450
export default class extends Vue {
5551
private activeName = 'directly'
5652
private inputData = 'https://github.com/Armour/vue-typescript-admin-template'
53+
private clipboardSuccess = clipboardSuccess
54+
private handleClipboard = handleClipboard
5755
}
5856
</script>

src/views/dashboard/admin/components/BarChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
:class="className"
4-
:style="{height: height,width: width}"
4+
:style="{height: height, width: width}"
55
/>
66
</template>
77

src/views/dashboard/admin/components/LineChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
:class="className"
4-
:style="{height: height,width: width}"
4+
:style="{height: height, width: width}"
55
/>
66
</template>
77

src/views/dashboard/admin/components/PieChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
:class="className"
4-
:style="{height: height,width: width}"
4+
:style="{height: height, width: width}"
55
/>
66
</template>
77

src/views/dashboard/admin/components/RadarChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
:class="className"
4-
:style="{height: height,width: width}"
4+
:style="{height: height, width: width}"
55
/>
66
</template>
77

src/views/example/components/ArticleDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
placeholder="Search user"
6767
>
6868
<el-option
69-
v-for="(item,index) in userListOptions"
69+
v-for="(item, index) in userListOptions"
7070
:key="item+index"
7171
:label="item"
7272
:value="item"

src/views/icons/index.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ import elementIcons from './element-icons'
5656
import svgIcons from './svg-icons'
5757
5858
@Component({
59-
name: 'Icons',
60-
methods: {
61-
handleClipboard
62-
}
59+
name: 'Icons'
6360
})
6461
export default class extends Vue {
6562
private svgIcons = svgIcons
6663
private elementIcons = elementIcons
64+
private handleClipboard = handleClipboard
6765
6866
private generateElementIconCode(symbol: string) {
6967
return `<i class="el-icon-${symbol}" />`

src/views/pdf/download.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import content from './content'
3232
name: 'PDFDownload'
3333
})
3434
export default class extends Vue {
35-
private article = {}
35+
private article: { title?: string, content?: string } = {}
3636
private fullscreenLoading = true
3737
3838
mounted() {

src/views/permission/directive.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,11 @@ import SwitchRoles from './components/SwitchRoles.vue'
135135
name: 'DirectivePermission',
136136
components: {
137137
SwitchRoles
138-
},
139-
methods: {
140-
checkPermission
141138
}
142139
})
143140
export default class extends Vue {
144141
private key = 1 // 为了能每次切换权限的时候重新初始化指令
142+
private checkPermission = checkPermission
145143
146144
private handleRolesChange() {
147145
this.key++

0 commit comments

Comments
 (0)