Skip to content

Commit 2609ca4

Browse files
committed
refactor: rename Vue.props with Vue.with
1 parent 9d11761 commit 2609ca4

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/vue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export interface VueConstructor<V extends VueBase = Vue> extends VueMixin<V> {
168168

169169
registerHooks(keys: string[]): void
170170

171-
props<P extends { new (): unknown }>(
171+
with<P extends { new (): unknown }>(
172172
Props: P
173173
): VueConstructor<V & VueWithProps<InstanceType<P>>>
174174
}
@@ -323,7 +323,7 @@ class VueImpl {
323323
this.__h.push(...keys)
324324
}
325325

326-
static props(Props: { new (): unknown }): VueConstructor {
326+
static with(Props: { new (): unknown }): VueConstructor {
327327
const propsMeta = new Props() as Record<string, Prop<any> | undefined>
328328
const props: ComponentObjectPropsOptions = {}
329329

test-dts/jsx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('JSX', () => {
2424
})
2525
}
2626

27-
class App extends Vue.props(Props) {}
27+
class App extends Vue.with(Props) {}
2828

2929
assertJsx(<App required="Hello" />)
3030
assertJsx(

test-dts/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('props', () => {
2929
invalidDefault: string = prop({ default: 'default' })
3030
}
3131

32-
class App extends Vue.props(Props) {
32+
class App extends Vue.with(Props) {
3333
mounted() {
3434
const vm = this
3535

test/specs/test.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ describe('vue-class-component', () => {
394394
baz = prop({ default: 'default value' })
395395
}
396396

397-
class App extends Vue.props(Props) {}
397+
class App extends Vue.with(Props) {}
398398

399399
const { root } = mount(App, {
400400
foo: 'foo test',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy