Update PTDoc.vue

pull/3913/head
Tuğçe Küçükoğlu 2023-04-28 12:50:49 +03:00
parent 8b21f70b96
commit 6005b67be7
1 changed files with 9 additions and 12 deletions

View File

@ -62,7 +62,9 @@ export default {
basic: ` basic: `
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" <SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }"
:pt="{ :pt="{
action: ({ props, state, menuitemId }) => ({ class: actionClass(state, menuitemId) }) action: ({ props, state, context }) => ({
class: context.active ? 'bg-primary' : undefined
})
}" }"
/>`, />`,
options: ` options: `
@ -71,7 +73,9 @@ export default {
<div :style="{ position: 'relative', height: '300px' }"> <div :style="{ position: 'relative', height: '300px' }">
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" <SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }"
:pt="{ :pt="{
action: ({ props, state, menuitemId }) => ({ class: actionClass(state, menuitemId) }) action: ({ props, state, context }) => ({
class: context.active ? 'bg-primary' : undefined
})
}" }"
/> />
</div> </div>
@ -121,11 +125,6 @@ export default {
} }
] ]
} }
},
methods: {
actionClass(state, menuitemId) {
return menuitemId === state.focusedOptionIndex ? 'bg-primary' : undefined;
}
} }
}; };
<\/script>`, <\/script>`,
@ -135,7 +134,9 @@ export default {
<div :style="{ position: 'relative', height: '300px' }"> <div :style="{ position: 'relative', height: '300px' }">
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" <SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }"
:pt="{ :pt="{
action: ({ props, state, menuitemId }) => ({ class: actionClass(state, menuitemId) }) action: ({ props, state, context }) => ({
class: context.active ? 'bg-primary' : undefined
})
}" }"
/> />
</div> </div>
@ -151,10 +152,6 @@ import { useRouter } from 'vue-router';
const toast = useToast(); const toast = useToast();
const router = useRouter(); const router = useRouter();
const actionClass => (state, menuitemId) = {
return menuitemId === state.focusedOptionIndex ? 'bg-primary' : undefined;
};
const items = ref([ const items = ref([
{ {
label: 'Add', label: 'Add',