-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/reactive-teleport
# Conflicts: # src/vnodeTransformers/util.ts
- Loading branch information
Showing
10 changed files
with
126 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# FAQ | ||
|
||
[[toc]] | ||
|
||
## Vue warn: Failed setting prop | ||
|
||
``` | ||
[Vue warn]: Failed setting prop "prefix" on <component-stub>: value foo is invalid. | ||
TypeError: Cannot set property prefix of #<Element> which has only a getter | ||
``` | ||
|
||
Cet avertissement est affiché si vous utilisez `shallowMount` ou `stubs` avec une propriété dont le nom est celui de l'une des propriétés de [`Element`](https://developer.mozilla.org/fr-FR/docs/Web/API/Element). | ||
|
||
Parmi les noms de propriétés courants partagés avec `Element` figurent : | ||
* `attributes` | ||
* `children` | ||
* `prefix` | ||
|
||
Voir https://developer.mozilla.org/en-US/docs/Web/API/Element | ||
|
||
**Solutions possibles** | ||
|
||
1. Utilisez `mount` au lieu de `shallowMount` pour rendre le composant sans utiliser de `stubs` | ||
2. Ignorez l'avertissement en utilisant un mock pour `console.warn` | ||
3. Renommez la propriété du composant pour éviter les conflits avec les propriétés de `Element` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# FAQ | ||
|
||
[[toc]] | ||
|
||
## Vue warn: Failed setting prop | ||
|
||
``` | ||
[Vue warn]: Failed setting prop "prefix" on <component-stub>: value foo is invalid. | ||
TypeError: Cannot set property prefix of #<Element> which has only a getter | ||
``` | ||
|
||
This warning is shown in case you are using `shallowMount` or `stubs` with a property name that is shared with [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element). | ||
|
||
Common property names that are shared with `Element`: | ||
* `attributes` | ||
* `children` | ||
* `prefix` | ||
|
||
See: https://developer.mozilla.org/en-US/docs/Web/API/Element | ||
|
||
**Possible solutions** | ||
|
||
1. Use `mount` instead of `shallowMount` to render without stubs | ||
2. Ignore the warning by mocking `console.warn` | ||
3. Rename the prop to not clash with `Element` properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
<template> | ||
<div> | ||
<h2>{{ name }}</h2> | ||
<Hello /> | ||
<RecursiveComponent v-if="first" /> | ||
<template | ||
v-for="item in items" | ||
:key="item" | ||
> | ||
<RecursiveComponent | ||
:name="item" | ||
/> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Hello from './Hello.vue' | ||
defineProps<{ | ||
first?: boolean | ||
name: string | ||
items?: string[] | ||
}>() | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters