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

feat: enhance state editor #349

Merged
merged 2 commits into from
Jul 30, 2023
Merged

Conversation

Jannchie
Copy link
Contributor

@Jannchie Jannchie commented Jul 29, 2023

Current Issue

Currently, StateEditor can only edit json like data.
However, we often store data of type string or number. If the value is an empty string or a number, "No data" is displayed. If you define useState('test:undefined', () => undefined), it even make the whole tab won't display.

In fact, we probably don't need "no data", because even if it's an empty array, object or even undefined or null, we should still be able to append data or edit it.


What I did

  • In this pr, I make sure that numbers and strings are edited properly and remain reactive.
  • Now "no data" will not be displayed so that we can edit empty arrays or objects.

legacy issue

There are still issues that have not been addressed:

Empty strings and undefined data currently show a strange built-in hint for third-party editors, although they can still be edited normally.

Type of empty strings data become number if a number is entered.

These may be issues with third party editors, perhaps we use simpler editing methods such as input element when editing numbers or strings.

image

@antfu antfu merged commit ad56f47 into nuxt:main Jul 30, 2023
3 checks passed
@Jannchie Jannchie deleted the feat/enhance-state-editor branch July 30, 2023 14:13
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

2 participants