-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(client):improve getter #230
Conversation
✅ Deploy Preview for vue-devtools-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Can we find a better way to handle it? e.g. mark pinia getters as not editable. /cc @alexzhang1030 |
@@ -118,7 +119,7 @@ function quickEditNum(v: number | string, offset: 1 | -1) { | |||
</template> | |||
</template> | |||
<!-- delete prop, only appear if depth > 0 --> | |||
<VueButton v-if="!props.disableEdit && depth > 0" v-bind="iconButtonProps" :class="buttonClass" @click.stop="quickEdit(rawValue, true)"> | |||
<VueButton v-if="!props.disableEdit && depth > 0 && props.rootId !== 'getters'" v-bind="iconButtonProps" :class="buttonClass" @click.stop="quickEdit(rawValue, true)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rootId: 'getters'
is not exclusively used by Pinia.
You can approach like passing { disableEdit: true }
from props in Pinia's getter field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have improved the code and thank you very much for your help. If you could help me check again, I would greatly appreciate it
@Azurewarth0920
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konata33
I think you can pass the disable-edit
to component InspectorState
(https://github.com/vuejs/devtools-next/blob/main/packages/client/src/pages/pinia.vue#L77) in getter field.
|
I think we can merge it for a temporary fix. For some reason, In the future, we will rewrite state editor protocol to be fully compatible with devtools-old. |
Thanks for the PR. I think we need to find a better way to handle it. Close it for now because we've made some changes to the codebase. |
There should be no delete icon in the getters function
Before:
After