File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -86,5 +86,14 @@ const editableProduct = ref<Product>({
8686 <p >I cannot delete a product.</p >
8787 </template >
8888 </Bouncer >
89+
90+ <Bouncer
91+ v-slot =" { can }"
92+ :ability =" deleteProduct"
93+ :args =" [product]"
94+ as =" p"
95+ >
96+ Can I delete the product ? {{ can ? 'Yes' : 'No' }}
97+ </Bouncer >
8998 </div >
9099</template >
Original file line number Diff line number Diff line change @@ -32,12 +32,18 @@ async function resolve() {
3232 :as =" props.as"
3333 >
3434 <slot
35- v-if =" can"
36- name =" can"
37- />
38- <slot
39- v-else
40- name =" cannot"
35+ v-if =" $slots.default"
36+ :can
4137 />
38+ <template v-else >
39+ <slot
40+ v-if =" can"
41+ name =" can"
42+ />
43+ <slot
44+ v-else
45+ name =" cannot"
46+ />
47+ </template >
4248 </Primitive >
4349</template >
You can’t perform that action at this time.
0 commit comments