You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v3.0.0, v-f-d is compatible with both decorators API stage 3 and stage 2 now.
4
+
5
+
# Decorators API stage 3
6
+
7
+
To enable this, you need to update TypeScript to 5.x and set `compilerOptions.experimentalDecorators` to `false` (value `true` for stage 2).
8
+
9
+
> Currently some vue libraries(e.g. Volar) may not compatible with TypeScript 5.x.
10
+
11
+
# Breaking changes
12
+
13
+
### Cast class component to vue options API
14
+
15
+
Using `toNative` to cast a class component to vue options API, after that, the casted component could be used as a native vue component in where vue accepts it.
16
+
17
+
> Currently `toNative` is not necessary, because v-f-d use a vue internal API, but it is not stable and may missing in the future vue verions. So `toNameve` is recommended.
18
+
19
+
```typescript
20
+
@Component
21
+
exportclassMyCompextendsVue{}
22
+
exportdefaulttoNative(MyComp)
23
+
24
+
//Code also works currently:
25
+
@Component
26
+
exportdefaultclassMyCompextendsVue{}
27
+
```
28
+
29
+
### Depreactate init class property despends on another in constructor
30
+
31
+
This is not allowed now.
32
+
```typescript
33
+
@Component({
34
+
name: "MyComponent"
35
+
})
36
+
exportclassMyComponentextendsVue {
37
+
@Prop
38
+
prop!:string
39
+
40
+
field =this.prop// this is deprecated, it will be undefined
41
+
}
42
+
43
+
exportdefaulttoNative(MyComponent)
44
+
```
45
+
46
+
### Remove `index-return-cons`
47
+
48
+
Remove `vue-facing-decorator/dist/index-return-cons`, you won't need this if `toNative` exists.
49
+
50
+
# What's new
51
+
52
+
*`createDecorator` has a preserve option. see docs.
0 commit comments