-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@casl/vue: wrong 'do' prop check in can.ts #695
Comments
I don't understand what it means that you cannot use |
You used For example <Can I="create" a="Post">...</Can> Properties {
"I": "create",
"do": undefined, // 'do' key exists. Vue always initializes with undefined value even if when you don't use 'do'.
"a": "Post",
// Skipped
} so... I don't understand why that test passed. |
I can confirm the <Can I="create" a="post">
<button>Create a new post</button>
</Can> I get this error:
Which seems to match @ahas explanation. Using |
fixed in @casl/vue@2.2.1 |
Describe the bug
Cannot use
I
prop inCan
componentTo Reproduce
It's an example from docs
Expected behavior
Can
component should useI
ordo
prop.if
I
is undefined then usedo
propor if
do
isundefined
then useI
prop.Let's see can.ts Line 66
I checked
props
parameter in debugger.Even if when I use
I
property but props has a key ofdo
withundefined
value.I think that condition should be like below
and also
detectSubjectProp
tooIt works for me !
CASL Version
@casl/ability
- v6.3.1@casl/vue
- v2.2.0Environment:
Node: v16.17.0
The text was updated successfully, but these errors were encountered: