Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix(client):improve getter #230

wants to merge 2 commits into from

Conversation

konata33
Copy link
Contributor

@konata33 konata33 commented Feb 5, 2024

There should be no delete icon in the getters function

Before:
before

After
after

Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for vue-devtools-docs ready!

Name Link
🔨 Latest commit d1a9d7c
🔍 Latest deploy log https://app.netlify.com/sites/vue-devtools-docs/deploys/65c1f12646a3f4000811383f
😎 Deploy Preview https://deploy-preview-230--vue-devtools-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@webfansplz
Copy link
Member

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)">
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Collaborator

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.

@konata33
Copy link
Contributor Author

konata33 commented Feb 5, 2024

Can we find a better way to handle it? e.g. mark pinia getters as not editable. /cc @alexzhang1030
This problem is consistent with the cause of #231, it would be great if there were variables that could distinguish them

@alexzhang1030
Copy link
Collaborator

alexzhang1030 commented Feb 5, 2024

I think we can merge it for a temporary fix. For some reason, devtools-next is not fully compatible with pinia tab (due to pinia has already implemented the old devtools protocol, but devtools-next is not.)

In the future, we will rewrite state editor protocol to be fully compatible with devtools-old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants