Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions examples/sites/demos/pc/app/carousel/webdoc/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,72 @@ export default {
},
codeFiles: ['dialog-show.vue']
}
],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the features array is correctly integrated with the existing code structure to avoid any potential issues with feature recognition or rendering.

features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置轮播图数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'auto-play',
name: '自动播放',
support: {
value: true
},
description: '通过 auto-play 设置是否自动播放,interval 设置自动播放的时间间隔。',
cloud: {
value: true
},
apis: ['auto-play', 'interval'],
demos: ['auto-play']
},
{
id: 'indicator',
name: '指示器',
support: {
value: true
},
description: '通过 indicator 设置指示器的位置,可选值为 inside、outside、none。',
cloud: {
value: true
},
apis: ['indicator'],
demos: ['indicator']
},
{
id: 'arrow',
name: '切换箭头',
support: {
value: true
},
description: '通过 arrow 设置切换箭头的显示时机,可选值为 hover、always、never。',
cloud: {
value: true
},
apis: ['arrow'],
demos: ['arrow']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当轮播图切换时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
Comment on lines +220 to +285
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix mismatched demo references in features array.

The newly added features array structure is well-organized and provides clear documentation of the carousel component's capabilities. However, several demo references don't match the actual demo IDs defined in the demos array:

  • auto-play (line 245) references a non-existent demo ID, should be autoplay
  • indicator (line 258) should reference indicator-trigger
  • arrow (line 271) should specify which arrow demo to reference (carousel-arrow-always, carousel-arrow-hover, or carousel-arrow-never)
  • events (line 283) should be carousel-events
  {
    id: 'auto-play',
    name: '自动播放',
    support: {
      value: true
    },
    description: '通过 auto-play 设置是否自动播放,interval 设置自动播放的时间间隔。',
    cloud: {
      value: true
    },
    apis: ['auto-play', 'interval'],
-   demos: ['auto-play']
+   demos: ['autoplay']
  },

And similarly for the other mismatched references.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置轮播图数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'auto-play',
name: '自动播放',
support: {
value: true
},
description: '通过 auto-play 设置是否自动播放,interval 设置自动播放的时间间隔。',
cloud: {
value: true
},
apis: ['auto-play', 'interval'],
demos: ['auto-play']
},
{
id: 'indicator',
name: '指示器',
support: {
value: true
},
description: '通过 indicator 设置指示器的位置,可选值为 inside、outside、none。',
cloud: {
value: true
},
apis: ['indicator'],
demos: ['indicator']
},
{
id: 'arrow',
name: '切换箭头',
support: {
value: true
},
description: '通过 arrow 设置切换箭头的显示时机,可选值为 hover、always、never。',
cloud: {
value: true
},
apis: ['arrow'],
demos: ['arrow']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当轮播图切换时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置轮播图数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'auto-play',
name: '自动播放',
support: {
value: true
},
description: '通过 auto-play 设置是否自动播放,interval 设置自动播放的时间间隔。',
cloud: {
value: true
},
apis: ['auto-play', 'interval'],
demos: ['autoplay']
},
{
id: 'indicator',
name: '指示器',
support: {
value: true
},
description: '通过 indicator 设置指示器的位置,可选值为 inside、outside、none。',
cloud: {
value: true
},
apis: ['indicator'],
demos: ['indicator-trigger']
},
{
id: 'arrow',
name: '切换箭头',
support: {
value: true
},
description: '通过 arrow 设置切换箭头的显示时机,可选值为 hover、always、never。',
cloud: {
value: true
},
apis: ['arrow'],
// Choose the appropriate arrow demo as required; here we select 'carousel-arrow-hover'
demos: ['carousel-arrow-hover']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当轮播图切换时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['carousel-events']
}
]

]
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,85 @@ export default {
},
codeFiles: ['change.vue']
}
],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify that the features array is properly connected to the existing code to prevent any issues with feature functionality or display.

features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置级联面板的数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'disabled',
name: '禁用状态',
support: {
value: true
},
description: '通过 disabled 设置是否禁用级联面板。',
cloud: {
value: true
},
apis: ['disabled'],
demos: ['disabled']
},
{
id: 'change-on-select',
name: '选择即改变',
support: {
value: true
},
description: '通过 change-on-select 设置选择即改变。',
cloud: {
value: true
},
apis: ['change-on-select'],
demos: ['show-all-levels']
},
{
id: 'multiple',
name: '多选功能',
support: {
value: true
},
description: '通过 multiple 设置是否为多选。',
cloud: {
value: true
},
apis: ['multiple'],
demos: ['multiple']
},
{
id: 'custom-option',
name: '自定义选项',
support: {
value: true
},
description: '通过 scoped slot 可以自定义备选项。',
cloud: {
value: true
},
apis: ['slot-default'],
demos: ['custom-option']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当选中节点变化时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
Comment on lines +76 to +154
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix mismatched demo references in features array.

The features array structure is excellent for documenting the cascader panel's capabilities. However, several demo references don't match the actual demo IDs defined in the demos array:

  • disabled (line 101) references a demo that doesn't exist in the demos array
  • show-all-levels (line 114) references a demo that doesn't exist
  • custom-option (line 140) should be custom-option-content
  • events (line 153) should be change
  {
    id: 'custom-option',
    name: '自定义选项',
    support: {
      value: true
    },
    description: '通过 scoped slot 可以自定义备选项。',
    cloud: {
      value: true
    },
    apis: ['slot-default'],
-   demos: ['custom-option']
+   demos: ['custom-option-content']
  },

Also review line 101 and 114 which reference demos that don't appear to exist in the demos array. Consider either adding these demos or updating the references.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置级联面板的数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'disabled',
name: '禁用状态',
support: {
value: true
},
description: '通过 disabled 设置是否禁用级联面板。',
cloud: {
value: true
},
apis: ['disabled'],
demos: ['disabled']
},
{
id: 'change-on-select',
name: '选择即改变',
support: {
value: true
},
description: '通过 change-on-select 设置选择即改变。',
cloud: {
value: true
},
apis: ['change-on-select'],
demos: ['show-all-levels']
},
{
id: 'multiple',
name: '多选功能',
support: {
value: true
},
description: '通过 multiple 设置是否为多选。',
cloud: {
value: true
},
apis: ['multiple'],
demos: ['multiple']
},
{
id: 'custom-option',
name: '自定义选项',
support: {
value: true
},
description: '通过 scoped slot 可以自定义备选项。',
cloud: {
value: true
},
apis: ['slot-default'],
demos: ['custom-option']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当选中节点变化时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置级联面板的数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'disabled',
name: '禁用状态',
support: {
value: true
},
description: '通过 disabled 设置是否禁用级联面板。',
cloud: {
value: true
},
apis: ['disabled'],
demos: ['disabled']
},
{
id: 'change-on-select',
name: '选择即改变',
support: {
value: true
},
description: '通过 change-on-select 设置选择即改变。',
cloud: {
value: true
},
apis: ['change-on-select'],
demos: ['show-all-levels']
},
{
id: 'multiple',
name: '多选功能',
support: {
value: true
},
description: '通过 multiple 设置是否为多选。',
cloud: {
value: true
},
apis: ['multiple'],
demos: ['multiple']
},
{
id: 'custom-option',
name: '自定义选项',
support: {
value: true
},
description: '通过 scoped slot 可以自定义备选项。',
cloud: {
value: true
},
apis: ['slot-default'],
demos: ['custom-option-content']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当选中节点变化时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
]

]
}
119 changes: 119 additions & 0 deletions examples/sites/demos/pc/app/cascader/webdoc/cascader.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,124 @@ export default {
},
codeFiles: ['slot.vue']
}
],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the features array is seamlessly integrated with the current code to avoid any potential problems with feature handling or visualization.

features: [
{
id: 'basic',
name: '基本功能',
support: {
value: true
},
description: '通过 data 设置级联选择器的数据。',
cloud: {
value: true
},
apis: ['data'],
demos: ['basic-usage']
},
{
id: 'disabled',
name: '禁用状态',
support: {
value: true
},
description: '通过 disabled 设置是否禁用级联选择器。',
cloud: {
value: true
},
apis: ['disabled'],
demos: ['disabled']
},
{
id: 'clearable',
name: '可清空',
support: {
value: true
},
description: '通过 clearable 设置输入框是否可清空。',
cloud: {
value: true
},
apis: ['clearable'],
demos: ['clearable']
},
{
id: 'size',
name: '尺寸设置',
support: {
value: true
},
description: '通过 size 设置级联选择器的尺寸,可选值为 medium、small、mini。',
cloud: {
value: true
},
apis: ['size'],
demos: ['size']
},
{
id: 'change-on-select',
name: '选择即改变',
support: {
value: true
},
description: '通过 change-on-select 设置选择即改变。',
cloud: {
value: true
},
apis: ['change-on-select'],
demos: ['show-all-levels']
},
{
id: 'multiple',
name: '多选功能',
support: {
value: true
},
description: '通过 multiple 设置是否为多选。',
cloud: {
value: true
},
apis: ['multiple'],
demos: ['multiple']
},
{
id: 'filterable',
name: '可搜索',
support: {
value: true
},
description: '通过 filterable 设置是否可搜索。',
cloud: {
value: true
},
apis: ['filterable'],
demos: ['filterable']
},
{
id: 'custom-option',
name: '自定义选项',
support: {
value: true
},
description: '通过 scoped slot 可以自定义备选项。',
cloud: {
value: true
},
apis: ['slot-default'],
demos: ['custom-option']
},
{
id: 'events',
name: '事件处理',
support: {
value: true
},
description: '当选中节点变化时会触发 change 事件。',
cloud: {
value: true
},
apis: ['change'],
demos: ['events']
}
]
}
Loading
Loading