diff --git a/docs/src/lib/example.svelte b/docs/src/lib/example.svelte index 72aa5c08..09e66d4d 100644 --- a/docs/src/lib/example.svelte +++ b/docs/src/lib/example.svelte @@ -11,7 +11,7 @@ CaretTop, } from '@svelement-ui/icon'; export let code = ''; - $: code = code.replaceAll('@@@>', '').trimStart().trimEnd(); + $: code = code.replaceAll('@@@>', '').replaceAll('@@@dolor', '$').trimStart().trimEnd(); let codeShowFlg = false; diff --git a/docs/src/lib/i18n/zh/input.js b/docs/src/lib/i18n/zh/input.js index 97c328dc..dcf28073 100644 --- a/docs/src/lib/i18n/zh/input.js +++ b/docs/src/lib/i18n/zh/input.js @@ -4,4 +4,17 @@ export default { cinput02010: '基础用法', cinput03010: '禁用状态', cinput03020: '通过 disabled 属性指定是否禁用 input 组件', + cinput04010: '一键清空', + cinput04020: '使用clearable属性即可得到一个可一键清空的输入框', + cinput05010: '格式化', + cinput05020: '在 formatter的情况下显示值,我们通常同时使用 parser', + cinput06010: '密码框', + cinput06020: '使用 showPassword 属性即可得到一个可切换显示隐藏的密码框', + cinput07010: '带图标的输入框', + cinput07020: '带有图标标记输入类型', + cinput07030: '要在输入框中添加图标,你可以简单地使用prefix 和 suffix 命名的插槽。', + cinput08010: '文本域', + cinput08020: + '用于输入多行文本信息可缩放的输入框。 添加 type="textarea" 属性来将 input 元素转换为原生的 textarea 元素。', + cinput08030: '文本域高度可通过 rows 属性控制', }; diff --git a/docs/src/routes/+layout.svelte b/docs/src/routes/+layout.svelte index 8d2feefd..c2b2fd36 100644 --- a/docs/src/routes/+layout.svelte +++ b/docs/src/routes/+layout.svelte @@ -2,16 +2,16 @@ import './app.css'; import { PUBLIC_BASE_PATH } from '$env/static/public'; import { + SvelButton, SvelCol, SvelContainer, SvelFooter, SvelHeader, + SvelLink, SvelMain, SvelRow, - SvelLink, - SvelButton, } from '@svelement-ui/all'; - import { SvelIcon, Github } from '@svelement-ui/icon'; + import { Github, SvelIcon } from '@svelement-ui/icon'; import { setContext } from 'svelte'; import { writable } from 'svelte/store'; import { default as zh } from '$lib/i18n/zh/index.js'; @@ -33,26 +33,26 @@ } - + - + SvelementUI - + Component - + {langString} @@ -64,7 +64,7 @@ -
+
diff --git a/docs/src/routes/component/input/+page.svelte b/docs/src/routes/component/input/+page.svelte index b66f8832..586da254 100644 --- a/docs/src/routes/component/input/+page.svelte +++ b/docs/src/routes/component/input/+page.svelte @@ -1,11 +1,15 @@

{$langFn('cinput01010')}

@@ -34,5 +38,123 @@ `} > - + + + +

{$langFn('cinput04010')}

+

{$langFn('cinput04020')}

+ + + let input1 = ''; +@@@/script> + +`} +> + + + +

{$langFn('cinput05010')}

+

{$langFn('cinput05020')}

+ + let inputF = ''; +@@@/script> + \`$ @@@dolor{value}\`.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')} + parser={(value) => value.replace(/\\$\\s?|(,*)/g, '')} +/> +`} +> + `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} + parser={(value) => value.replace(/\$\s?|(,*)/g, '')} + placeholder="Please input" + /> + + +

{$langFn('cinput06010')}

+

{$langFn('cinput06020')}

+ + + let input1 = ''; +@@@/script> + +`} +> + + + +

{$langFn('cinput07010')}

+

{$langFn('cinput07020')}

+

{$langFn('cinput07030')}

+ + + + + Using slots + + + + + + + + + + + + + + + + +
+`} +> +
+ + + Using slots + + + + + + + + + + + + + + + + +
+ + +

{$langFn('cinput08010')}

+

{$langFn('cinput08020')}

+

{$langFn('cinput08030')}

+ + + let textarea = ''; +@@@/script> + +`} +> +