-
Notifications
You must be signed in to change notification settings - Fork 337
docs(tag-input): add example #3962
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,182 @@ | ||||||||||
| export default { | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| apis: [ | ||||||||||
| { | ||||||||||
| name: 'tag-input', | ||||||||||
| type: 'component', | ||||||||||
| props: [ | ||||||||||
| { | ||||||||||
| name: 'model-value / v-model', | ||||||||||
| type: 'array', | ||||||||||
| defaultValue: '[]', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '绑定值', | ||||||||||
| 'en-US': 'Binding Value' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'tag-group-size', | ||||||||||
| mfDemo: 'tag-group-size' | ||||||||||
|
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect demo references. The demo references 🔎 Proposed fix- pcDemo: 'tag-group-size',
- mfDemo: 'tag-group-size'
+ pcDemo: 'basic-usage',
+ mfDemo: 'basic-usage'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'size', | ||||||||||
| type: "'medium' | 'small'", | ||||||||||
| defaultValue: "'medium'", | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '尺寸', | ||||||||||
| 'en-US': 'Size ' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'tag-group-size', | ||||||||||
| mfDemo: 'tag-group-size' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'tag-type', | ||||||||||
| typeAnchorName: 'IType', | ||||||||||
| type: 'IType', | ||||||||||
| defaultValue: '', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '显示类型', | ||||||||||
| 'en-US': 'Display type' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'tag-effect', | ||||||||||
| typeAnchorName: 'IEffect', | ||||||||||
| type: 'IEffect', | ||||||||||
| defaultValue: "'light'", | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '主题', | ||||||||||
| 'en-US': 'Theme Color' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'effect', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'clearable', | ||||||||||
| type: 'boolean', | ||||||||||
| defaultValue: 'false', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '是否可清空', | ||||||||||
| 'en-US': 'Whether it can be cleared' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'disabled', | ||||||||||
| type: 'boolean', | ||||||||||
| defaultValue: 'false', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '是否禁用标签输入框', | ||||||||||
| 'en-US': 'Whether the tag input box is disabled' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'max', | ||||||||||
| type: 'number', | ||||||||||
| defaultValue: 'Infinity', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '最大允许输入的标签数量', | ||||||||||
| 'en-US': 'Maximum number of tags allowed to be input' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'placeholder', | ||||||||||
| type: 'string', | ||||||||||
| defaultValue: '', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '占位符', | ||||||||||
| 'en-US': 'Placeholder' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'readonly', | ||||||||||
| type: 'boolean', | ||||||||||
| defaultValue: 'false', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '是否只读', | ||||||||||
| 'en-US': 'Whether it is read-only' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'draggable', | ||||||||||
| type: 'boolean', | ||||||||||
| defaultValue: 'false', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '是否可拖拽', | ||||||||||
| 'en-US': 'Whether it is draggable' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'minCollapsedNum', | ||||||||||
| type: 'number', | ||||||||||
| defaultValue: 'Infinity', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '最小折叠数量', | ||||||||||
| 'en-US': 'Minimum collapsed number' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'separator', | ||||||||||
| type: 'string', | ||||||||||
| defaultValue: ',', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '批量输入时标签分隔符', | ||||||||||
| 'en-US': 'Tag separator for batch input' | ||||||||||
| }, | ||||||||||
| mode: ['pc', 'mobile-first'], | ||||||||||
| pcDemo: 'basic-usage', | ||||||||||
| mfDemo: '' | ||||||||||
| } | ||||||||||
| ], | ||||||||||
| events: [], | ||||||||||
| methods: [], | ||||||||||
| slots: [ | ||||||||||
| { | ||||||||||
| name: 'prefix', | ||||||||||
| defaultValue: '', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '输入框前缀内容的插槽', | ||||||||||
| 'en-US': 'Input prefix slot' | ||||||||||
| }, | ||||||||||
| mode: ['pc'], | ||||||||||
| pcDemo: 'basic-usage' | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| name: 'suffix', | ||||||||||
| defaultValue: '', | ||||||||||
| desc: { | ||||||||||
| 'zh-CN': '输入框后缀内容的插槽', | ||||||||||
| 'en-US': 'Input suffix slot' | ||||||||||
| }, | ||||||||||
| mode: ['pc'], | ||||||||||
| pcDemo: 'basic-usage' | ||||||||||
| } | ||||||||||
| ] | ||||||||||
| } | ||||||||||
| ], | ||||||||||
| types: [] | ||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <tiny-tag-input v-model="data" :placeholder="placeholder"></tiny-tag-input> | ||
| <tiny-tag-input v-model="data1" :placeholder="placeholder" tag-type="info" tag-effect="light"></tiny-tag-input> | ||
| <tiny-tag-input v-model="data2" :placeholder="placeholder" tag-type="success" tag-effect="plain"></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
| import { reactive, ref } from 'vue' | ||
|
|
||
| const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||
| const data1 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||
| const data2 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||
| const placeholder = ref('please enter a tag') | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||
| <template> | ||||||||||||
| <div class="tiny-tag-input-demo"> | ||||||||||||
| <tiny-tag-input v-model="data" :placeholder="placeholder"></tiny-tag-input> | ||||||||||||
| <tiny-tag-input v-model="data1" :placeholder="placeholder" tag-type="info" tag-effect="light"></tiny-tag-input> | ||||||||||||
| <tiny-tag-input v-model="data2" :placeholder="placeholder" tag-type="success" tag-effect="plain"></tiny-tag-input> | ||||||||||||
| </div> | ||||||||||||
| </template> | ||||||||||||
|
|
||||||||||||
| <script> | ||||||||||||
| import { TinyTagInput } from '@opentiny/vue' | ||||||||||||
|
|
||||||||||||
| export default { | ||||||||||||
| components: { | ||||||||||||
| TinyTagInput | ||||||||||||
| }, | ||||||||||||
| data() { | ||||||||||||
| return { | ||||||||||||
| data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||||||||||||
| data1: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||||||||||||
| data2: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||||||||||||
| maxTagCount: 3, | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Remove unused variable. The 🔎 Proposed fix data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
data1: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
data2: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
- maxTagCount: 3,
placeholder: 'please enter a tag'Or if you intend to demonstrate the - <tiny-tag-input v-model="data" :placeholder="placeholder"></tiny-tag-input>
+ <tiny-tag-input v-model="data" :placeholder="placeholder" :max="maxTagCount"></tiny-tag-input>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| placeholder: 'please enter a tag' | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| </script> | ||||||||||||
|
|
||||||||||||
| <style scoped> | ||||||||||||
| .tiny-tag-input-demo .tiny-tag-input { | ||||||||||||
| margin-bottom: 20px; | ||||||||||||
| } | ||||||||||||
| </style> | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <tiny-tag-input v-model="data" :placeholder="placeholder" clearable></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
| import { reactive, ref } from 'vue' | ||
|
|
||
| const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||
|
|
||
| const placeholder = ref('please enter a tag') | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <tiny-tag-input v-model="data" :placeholder="placeholder" clearable></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyTagInput | ||
| }, | ||
| data() { | ||
| return { | ||
| data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||
| placeholder: 'please enter a tag' | ||
| } | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <tiny-tag-input v-model="data" :placeholder="placeholder" :min-collapsed-num="minCollapsedNum"></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
| import { reactive, ref } from 'vue' | ||
|
|
||
| const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||
| const minCollapsedNum = ref(5) | ||
| const placeholder = ref('please enter a tag') | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <tiny-tag-input v-model="data" :placeholder="placeholder" :min-collapsed-num="minCollapsedNum"></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyTagInput | ||
| }, | ||
| data() { | ||
| return { | ||
| data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||
| placeholder: 'please enter a tag', | ||
| minCollapsedNum: 5 | ||
| } | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||
| <template> | ||||||||||||
| <div class="tiny-tag-input-demo"> | ||||||||||||
| <span>disabled: </span><tiny-tag-input v-model="data" :placeholder="placeholder" disabled></tiny-tag-input> | ||||||||||||
| <span>readonly:</span><tiny-tag-input v-model="data1" :placeholder="placeholder" readonly></tiny-tag-input> | ||||||||||||
|
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing The template references 🔎 Proposed fix const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
const data1 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
+const placeholder = 'please enter a tag'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| </div> | ||||||||||||
| </template> | ||||||||||||
|
|
||||||||||||
| <script setup> | ||||||||||||
| import { reactive } from 'vue' | ||||||||||||
| import { TinyTagInput } from '@opentiny/vue' | ||||||||||||
|
|
||||||||||||
| const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||||||||||||
| const data1 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']) | ||||||||||||
| </script> | ||||||||||||
|
|
||||||||||||
| <style scoped> | ||||||||||||
| .tiny-tag-input-demo .tiny-tag-input { | ||||||||||||
| margin-bottom: 20px; | ||||||||||||
| } | ||||||||||||
| </style> | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <template> | ||
| <div class="tiny-tag-input-demo"> | ||
| <span>disabled: </span><tiny-tag-input v-model="data" :placeholder="placeholder" disabled></tiny-tag-input> | ||
| <span>readonly:</span><tiny-tag-input v-model="data1" :placeholder="placeholder" readonly></tiny-tag-input> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyTagInput } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyTagInput | ||
| }, | ||
| data() { | ||
| return { | ||
| data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||
| data1: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'], | ||
| placeholder: 'please enter a tag' | ||
| } | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .tiny-tag-input-demo .tiny-tag-input { | ||
| margin-bottom: 20px; | ||
| } | ||
| </style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hidden zero-width character in English description.
The English description contains a zero-width non-joiner character (U+200C) before "Binding Value". This invisible character may cause display or search issues.
🔎 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents