carbon-design-system / carbon-components-vue

Vue implementation of the Carbon Design System
http://vue.carbondesignsystem.com
Apache License 2.0
598 stars 177 forks source link

feat: port cv-structured-list to Vue3 #1513

Closed OlkaB closed 10 months ago

OlkaB commented 10 months ago

Contributes to #1511

 What did you do?

Port CvStructuredList to Vue3

How have you tested it?

see spec.js files

Were docs updated if needed?

davidnixon commented 10 months ago

Looks really nice. Thanks!

There are some warnings in the console.

[Vue warn]: Property "withVModel" was accessed during render but is not defined on instance [Vue warn]: Property "listValue" was accessed during render but is not defined on instance. runtime-core.esm-bundler.js:41 [Vue warn]: Property "onChange" was accessed during render but is not defined on instance.

Since both stories use the same template the default story still needs to define attributes:

--- a/src/components/CvStructuredList/CvStructuredList.stories.js
+++ b/src/components/CvStructuredList/CvStructuredList.stories.js
@@ -111,7 +111,10 @@ const Template = args => {
     },
     setup: () => ({
       args,
+      listValue: ref(DefaultListItems[0].id),
       DefaultListItems,
+      onChange: action('change'),
+      withVModel: false,
     }),
     template,
   };
OlkaB commented 10 months ago

fixed. thank you @davidnixon