Files
aurora-admin/site/examples/checkboxcard.json
T

39 lines
4.6 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"slug": "checkboxcard",
"mode": "single",
"curated": true,
"examples": [
{
"id": "checkboxcard-ex-1",
"title": "基础用法",
"titleSrc": "",
"desc": "",
"html": "<div class=\"kole-checkcard-grid\" id=\"app\" role=\"radio\" tabindex=\"0\" style=\"grid-template-columns:repeat(3,1fr)\"></div>",
"preview": {
"show": [
[
0
]
],
"hide": [],
"mode": "single"
},
"previewSafe": true,
"previewUnsafeReasons": [],
"source": "curated",
"code": {
"html": "<div class=\"kole-checkcard-grid\" role=\"radio\" tabindex=\"0\" style=\"grid-template-columns:repeat(3,1fr)\"></div>",
"jsx": "import { useState } from 'react';\nimport { KoleCheckboxCard } from 'kole-ui/react';\n\nconst options = [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n];\n\nexport default function Demo() {\n const [value, setValue] = useState(['analytics']);\n return <KoleCheckboxCard options={options} value={value} cols={3} onChange={setValue} />;\n}",
"vue3": "<template>\n <KoleCheckboxCard v-model=\"value\" :options=\"options\" :cols=\"3\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nimport { KoleCheckboxCard } from 'kole-ui/vue3';\n\nconst options = [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n];\nconst value = ref(['analytics']);\n</script>",
"vue2": "<template>\n <KoleCheckboxCard v-model=\"value\" :options=\"options\" :cols=\"3\" />\n</template>\n\n<script>\nimport { KoleCheckboxCard } from 'kole-ui/vue2';\n\nexport default {\n components: { KoleCheckboxCard },\n data() {\n return {\n options: [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n ],\n value: ['analytics']\n };\n }\n};\n</script>",
"tsx": "import { useState } from 'react';\nimport { KoleCheckboxCard } from 'kole-ui/react';\n\nconst options = [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n];\n\nexport default function Demo(): JSX.Element {\n const [value, setValue] = useState(['analytics']);\n return <KoleCheckboxCard options={options} value={value} cols={3} onChange={setValue} />;\n}",
"vue3ts": "<template>\n\n <KoleCheckboxCard v-model=\"value\" :options=\"options\" :cols=\"3\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { KoleCheckboxCard } from 'kole-ui/vue3';\n\nconst demoTitle = ref<string>('基础用法');\nconst options = [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n];\nconst value = ref(['analytics']);\n</script>",
"vue2ts": "<template>\n\n <KoleCheckboxCard v-model=\"value\" :options=\"options\" :cols=\"3\" />\n</template>\n\n<script lang=\"ts\">\nimport Vue from 'vue';\nimport { KoleCheckboxCard } from 'kole-ui/vue2';\n\nexport default {\n components: { KoleCheckboxCard },\n data(): Record<string, unknown> {\n return {\n options: [\n { label: '数据分析', value: 'analytics', desc: '多维度报表与漏斗分析。', icon: '📊' },\n { label: '消息推送', value: 'push', desc: '全渠道触达与定时发送。', icon: '🔔' },\n { label: '权限管理', value: 'rbac', desc: '角色与数据权限配置。', icon: '🔐' }\n ],\n value: ['analytics']\n };\n }\n};\n</script>"
},
"notes": [
"依据 frameworks/CheckboxCard.html:15-20 的 DATA 三项与 selected=['analytics']、:12 grid-template-columns:repeat(3,1fr)(cols=3);prop 名取自 frameworks/CheckboxCard.jsx:4(options/value/cols)"
]
}
]
}