Skip to content

Commit f27a54e

Browse files
author
Guillaume Chau
committed
test(ts): class decorator
1 parent 97d317e commit f27a54e

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"typescript": "^2.9.2",
7272
"uglify-es": "^3.1.6",
7373
"vue": "^2.5.16",
74+
"vue-property-decorator": "^7.0.0",
7475
"vuepress": "^0.14.2"
7576
}
7677
}

types/test/Decorator.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component, Vue } from 'vue-property-decorator'
2+
3+
@Component({
4+
apollo: {
5+
allFilms: '',
6+
},
7+
})
8+
export default class Decorator extends Vue {
9+
allFilms = []
10+
}

types/test/index.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HttpLink } from 'apollo-link-http'
66

77
import VueApollo from '../index'
88
import App from './App'
9+
import Decorator from './Decorator'
910

1011
const httpLink = new HttpLink({ uri: 'https://dummy.test.com' })
1112
const cache: any = 'dummy cache';
@@ -26,4 +27,10 @@ const apolloProvider = new VueApollo({
2627
Vue.use(VueApollo)
2728

2829
/* eslint no-new: 0 */
29-
new Vue({ el: '#app', provide: apolloProvider.provide(), render: h => h(App) })
30+
new Vue({
31+
el: '#app',
32+
provide: apolloProvider.provide(),
33+
render: h => h(App, [
34+
h(Decorator)
35+
])
36+
})

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -7209,6 +7209,10 @@ [email protected]:
72097209
dependencies:
72107210
indexof "0.0.1"
72117211

7212+
vue-class-component@^6.2.0:
7213+
version "6.2.0"
7214+
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-6.2.0.tgz#7adb1daa9a868c75f30f97f33f4f1b94aee62089"
7215+
72127216
vue-hot-reload-api@^2.3.0:
72137217
version "2.3.0"
72147218
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz#97976142405d13d8efae154749e88c4e358cf926"
@@ -7223,6 +7227,12 @@ vue-loader@^15.2.4:
72237227
vue-hot-reload-api "^2.3.0"
72247228
vue-style-loader "^4.1.0"
72257229

7230+
vue-property-decorator@^7.0.0:
7231+
version "7.0.0"
7232+
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-7.0.0.tgz#46f53dd741eb86c3af091bb0492400c450eebf19"
7233+
dependencies:
7234+
vue-class-component "^6.2.0"
7235+
72267236
vue-router@^3.0.1:
72277237
version "3.0.1"
72287238
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"

0 commit comments

Comments
 (0)