mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-30 05:16:56 -06:00
M6: default Vue instance swaps and keep text out of attribute detection
A Vue component's instance-swap prop now defaults to its component reference in withDefaults, so the dynamic component renders the design default. Attribute detection only applies inside an unfinished opening tag, so text like `Total = {title}` stays text instead of becoming a quoted attribute value.
This commit is contained in:
@@ -228,6 +228,7 @@ fn instance_swap_properties_take_views() {
|
||||
assert!(leptos.contains("{icon.run()}"), "{leptos}");
|
||||
let vue = code(&mut s, chip, "vue");
|
||||
assert!(vue.contains(" icon?: unknown;"), "{vue}");
|
||||
assert!(vue.contains(" icon: HeartIcon,"), "the swap defaults to its component: {vue}");
|
||||
assert!(vue.contains("<component :is=\"icon\" />"), "a swap is a component, not an element: {vue}");
|
||||
let i = idv(&ex(&mut s, "instance.create", json!({"component": chip, "x": 0, "y": 100})));
|
||||
ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Icon": star}}));
|
||||
|
||||
Reference in New Issue
Block a user