{ "slug": "exceptionvariants", "mode": "scenarios", "examples": [ { "id": "exceptionvariants-ex-1", "title": "403 禁止访问", "titleSrc": "script", "desc": "", "html": "
\n
\n
", "preview": { "show": [ [ 0 ] ], "hide": [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ], "mode": "scenarios" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
", "jsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\n// 403 禁止访问:抱歉,你没有权限访问此页面。\nconst goHome = () => { location.href = '/'; };\nconst retry = () => location.reload();\n\n", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\nexport default function KoleExceptionVariantsDemo(): JSX.Element {\n // 403 禁止访问:抱歉,你没有权限访问此页面。\n const goHome = () => { location.href = '/'; };\n const retry = () => location.reload();\n return (\n \n );\n}", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/ExceptionVariants.html:19-24 的 DATA['403'](emoji/title/desc)与该行 data-type=\"403\" 的卡片", "type 为演示页 data-type 实参;返回首页/重试两个按钮在组件内固定渲染,对应 emits home/retry(site/data.json exceptionvariants.api.emits)" ] }, { "id": "exceptionvariants-ex-2", "title": "404 页面不存在", "titleSrc": "script", "desc": "", "html": "
\n
\n
", "preview": { "show": [ [ 1 ] ], "hide": [ [ 0 ], [ 2 ], [ 3 ], [ 4 ] ], "mode": "scenarios" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
", "jsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\n// 404 页面不存在:你访问的页面已被移除或从未存在。\n// 预设 type=\"404\" 已含 emoji/title/desc;下面显式覆盖为演示页 DATA['404'] 的同一组值\n", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\nexport default function KoleExceptionVariantsDemo(): JSX.Element {\n // 404 页面不存在:你访问的页面已被移除或从未存在。\n // 预设 type=\"404\" 已含 emoji/title/desc;下面显式覆盖为演示页 DATA['404'] 的同一组值\n return (\n \n );\n}", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/ExceptionVariants.html:19-24 的 DATA['404'](emoji/title/desc)与该行 data-type=\"404\" 的卡片", "emoji/title/desc 为演示页 DATA 的实参(与组件内 PRESET 同值),片段演示显式覆盖写法" ] }, { "id": "exceptionvariants-ex-3", "title": "500 服务器错误", "titleSrc": "script", "desc": "", "html": "
\n
\n
", "preview": { "show": [ [ 2 ] ], "hide": [ [ 0 ], [ 1 ], [ 3 ], [ 4 ] ], "mode": "scenarios" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
", "jsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\n// 500 服务器错误:服务器开小差了,请稍后再试。\nconst retry = () => location.reload();\n\n", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\nexport default function KoleExceptionVariantsDemo(): JSX.Element {\n // 500 服务器错误:服务器开小差了,请稍后再试。\n const retry = () => location.reload();\n return (\n \n );\n}", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/ExceptionVariants.html:19-24 的 DATA['500'](emoji/title/desc)与该行 data-type=\"500\" 的卡片", "type 为演示页 data-type 实参;返回首页/重试两个按钮在组件内固定渲染,对应 emits home/retry(site/data.json exceptionvariants.api.emits)" ] }, { "id": "exceptionvariants-ex-4", "title": "502 网关错误", "titleSrc": "script", "desc": "", "html": "
\n
\n
", "preview": { "show": [ [ 3 ] ], "hide": [ [ 0 ], [ 1 ], [ 2 ], [ 4 ] ], "mode": "scenarios" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
", "jsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\n// 502 网关错误:网关无响应,请检查网络后重试。\nconst goHome = () => { location.href = '/'; };\nconst retry = () => location.reload();\n\n", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { KoleExceptionVariants } from 'kole-ui/react';\n\nexport default function KoleExceptionVariantsDemo(): JSX.Element {\n // 502 网关错误:网关无响应,请检查网络后重试。\n const goHome = () => { location.href = '/'; };\n const retry = () => location.reload();\n return (\n \n );\n}", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/ExceptionVariants.html:19-24 的 DATA['502'](emoji/title/desc)与该行 data-type=\"502\" 的卡片", "type 为演示页 data-type 实参;返回首页/重试两个按钮在组件内固定渲染,对应 emits home/retry(site/data.json exceptionvariants.api.emits)" ] } ], "curated": true }