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

Vue not able to extract prop from ReadonlyArray and readonly #10726

Closed
VividLemon opened this issue Apr 17, 2024 · 2 comments
Closed

Vue not able to extract prop from ReadonlyArray and readonly #10726

VividLemon opened this issue Apr 17, 2024 · 2 comments
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: script-setup scope: types

Comments

@VividLemon
Copy link

Vue version

3.4.23

Link to minimal reproduction

https://play.vuejs.org/#eNqFUttuEzEQ/ZXBLylS2BWEp2oTCVAlQOKigOABI7TdnWzdem3LlzTVdv+dsZ0sKerlzXPOjOfMzBnYG2OKbUB2yirXWGE8OPTBgKxVt+TMO85WXIneaOthAIsbGGFjdQ8zKptN1Dvdm4xzVpQxit9yxhVXjVbOQ+86WMYPTmbvUUoNP7WV7bPZc66qMvemThR47I2sPVIEUF28XA1DKh7HqqQooand9kWvW5Qkk2jOoCSuKqdyNif51HsjuuLSaUUzDrGYs4aqhUT7xXhB2jg7hcREriZp1x8T5m3A+QFvLrC5uge/dLuIcfbVokO7pZknzte2Q5/ps2+fcUfviSTtQVL2I+QanZYhasxpb4NqSfZRXlL7IZ1AqO67O9t5VO4wVBQaM8eUzxldJC7uodH/yV0Ui1TH1UhbPFzzCZPgLjnB3xiEdd0K/aOWAWEZf7qFc60l1nTfGDhvSW5+W6xbreQNBHWl9LX69Tvj6z1erbHRtq1yzfyQtkpGuAUV+nNayf4t5ZHhojn2GqDFjVD4KULVkbhcszq5a8L/LCiUCXmuOGw61LH3pjZpC3cN+GeLNp6DVrcoXhevFmz8C0O8KxY=

Steps to reproduce

readonly number[] -- https://play.vuejs.org/#eNqFUttuEzEQ/ZXBLylS2BWEp2oTCVAlQOKigOABI7TdnWzdem3LlzTVdv+dsZ0sKerlzXPOjOfMzBnYG2OKbUB2yirXWGE8OPTBgKxVt+TMO85WXIneaOthAIsbGGFjdQ8zKptN1Dvdm4xzVpQxit9yxhVXjVbOQ+86WMYPTmbvUUoNP7WV7bPZc66qMvemThR47I2sPVIEUF28XA1DKh7HqqQooand9kWvW5Qkk2jOoCSuKqdyNif51HsjuuLSaUUzDrGYs4aqhUT7xXhB2jg7hcREriZp1x8T5m3A+QFvLrC5uge/dLuIcfbVokO7pZknzte2Q5/ps2+fcUfviSTtQVL2I+QanZYhasxpb4NqSfZRXlL7IZ1AqO67O9t5VO4wVBQaM8eUzxldJC7uodH/yV0Ui1TH1UhbPFzzCZPgLjnB3xiEdd0K/aOWAWEZf7qFc60l1nTfGDhvSW5+W6xbreQNBHWl9LX69Tvj6z1erbHRtq1yzfyQtkpGuAUV+nNayf4t5ZHhojn2GqDFjVD4KULVkbhcszq5a8L/LCiUCXmuOGw61LH3pjZpC3cN+GeLNp6DVrcoXhevFmz8C0O8KxY=

Causes "modelValue": { type: [Boolean, String], skipCheck: true },

ReadonlyArray<number> https://play.vuejs.org/#eNqFUttu2zAM/RVOL+mAzMaWPRVOgG4osA3YBdmwvQgYVJtx1cqSoEuawPO/j5ITNx3W9k3k4REPydOzC2uLbUR2zipfO2kDeAzRghK6XXIWPGcrrmVnjQvQg8MNDLBxpoMZ0WYT9N50dsxzVpQpSt9yxjXXtdE+QOdbWKYPzmYfUCkDv4xTzYvZS66rcuxNnSgI2FklAlIEUF2/XvV9Jg9DVVKUs7nd9lVnGlQkk2DOoCSsKic6m5N86r2RbXHjjaYZ+0TmrCa2VOi+2iBJG2fnkJGECZJ29ynngos4P+bra6xv/5O/8buU4+ybQ49uSzNPWBCuxTDCl9+/4I7eE0jao6LqJ8A1eqNi0jiWvYu6IdkndVntx3wCqdsf/nIXUPvjUEloqhxyPWd0kbS4x0a/l7soFpnH9UBbPF7zGZPgLjsh7C3CWjTS/BQqIizTT3/gyhiFgu6bAh8cyR3faxSN0Wp/4ZzYV1HfanOn85XvsWqNtXFNNfLmcKw6lOnYXdFaDm+lTkyXDHLQAQ1upMbPKVWdCBw5q7OHRvzHhlLbOM6WBs7HOvXf1CZv4qEJf2/RpZPQ+hbF2+LNgg1/AQiFLJc=

Causes "modelValue": { type: [Boolean, String], skipCheck: true },

Readonly<number[]> https://play.vuejs.org/#eNqFUttu00AQ/ZVhX1KkYAvCU+VEAlQJkLgoIHhgEXLtiet2PbvaS5rK+N+ZXSfGRUDfdubM2Tkzc3rxwphsH1Cci8JVtjUeHPpgQJXUrKXwToqNpLYz2nroweIOBthZ3cGCaYsJeqU7M+alyPIYxW+lkCSp0uQ8dK6BdfzgbPEaldLwVVtVP1o8llTkY2/uxIHHzqjSI0cAxdXTTd8n8jAUOUcpm9rtn3S6RsUyGZYCcsaKfKKLJcvn3ru2ya6dJp6xj2QpKma3Cu0H41vWJsU5JCRiJUu7fZty3gZcnvLVFVY3f8lfu0PMSfHRokO755knzJe2QT/CF5/e44HfE8jag+Lq/4BbdFqFqHEsexmoZtmzuqT2TTpBS81nd3HwSO40VBQaK4dULwVfJC7uX6P/lrvKVoknaeAtnq75gEnwkJzg7wzCtqxb/aVUAWEdf/oJl1orLPm+MXDestzxvcWy1qTuikA3pG/p2/d04hmwxUrbuhhJSzjWbY5lFLpL3snxrdTMcdEdRxFQ464lfBdTxUzdyNmc3XfhHx5syYRxsDhtutTcfFObtIb7DvyxRxvvwbtbZc+zZysx/AJSRitQ

Causes "modelValue": { type: [Boolean, String, Object, Number, null] },

Inspect the Comp.vue dist js prop definitions

What is expected?

All three variations should have modelvalue be "modelValue": { type: [Boolean, String, Object, Number, null] },

What is actually happening?

Vue not able to readonly or ReadonlyArray as Object

System Info

No response

Any additional comments?

No response

@NathanFreeman
Copy link

#10746

@xvaara
Copy link

xvaara commented Apr 23, 2024

@yyx990803 It doesn't work on production. In production build these are still compiler as { type: [Boolean, String] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: script-setup scope: types
Projects
None yet
Development

No branches or pull requests

4 participants