File tree Expand file tree Collapse file tree 13 files changed +616
-590
lines changed Expand file tree Collapse file tree 13 files changed +616
-590
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ export default defineConfig({
9090 text : 'Input 输入框' ,
9191 link : '/components/input' ,
9292 } ,
93+ {
94+ text : 'MdInput 输入框' ,
95+ link : '/components/mdinput' ,
96+ } ,
9397 {
9498 text : 'Checkbox 复选框' ,
9599 link : '/components/checkbox' ,
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import '../../../style/page-header';
3939import '../../../style/tag' ;
4040import '../../../style/pagination' ;
4141import '../../../style/tanstack-table' ;
42+ import '../../../style/md-input' ;
4243
4344export default {
4445 extends : DefaultTheme ,
Original file line number Diff line number Diff line change 1+ # MdInput
2+
3+ ` Material Design ` 风格的输入框; ` Material Design ` 是由 ` Google ` 设计的视觉语言。
4+
5+ > 组件使用名称为: ` nt-md-input `
6+
7+ ## 演示
8+
9+ <script setup >
10+ import { MdInput } from " ../../src"
11+ import { ref , watch } from ' vue'
12+
13+ const value = ref (' ' )
14+ </script >
15+
16+ ### 使用
17+
18+ 传递 ` v-model ` 接收输入。
19+
20+ <ClientOnly >
21+ <CodePreview >
22+ <textarea lang =" vue " >
23+ <script setup lang="ts">
24+ import { ref, watch } from 'vue'
25+ //-
26+ const value = ref('')
27+ </script>
28+ <template>
29+ <nt-md-input v-model="value" label="姓名"></nt-md-input>
30+ </template>
31+ </textarea >
32+ <template #preview>
33+ <MdInput v-model =" value " label =" 姓名 " ></MdInput >
34+ </template >
35+ </CodePreview >
36+ </ClientOnly >
37+
38+ ### 四周边框
39+
40+ 只需要传递 ` outline ` 属性,就能让输入框带有边框。
41+
42+ <ClientOnly >
43+ <CodePreview >
44+ <textarea lang =" vue-html " >
45+ <nt-md-input v-model="value" label="姓名" outline></nt-md-input>
46+ </textarea >
47+ <template #preview>
48+ <MdInput v-model =" value " label =" 姓名 " outline ></MdInput >
49+ </template >
50+ </CodePreview >
51+ </ClientOnly >
52+
53+ ## API
54+
55+ ### MdInput Props
56+
57+ <!-- prettier-ignore -->
58+ | 参数 | 说明 | 类型 | 默认值 |
59+ | --- | --- | --- | --- |
60+ | ` outline ` | 是否显示四周边框 | ` boolean ` | ` false ` |
61+ | ` id ` | 输入框的 id | ` string ` | - |
62+ | ` label ` | 输入框的标签 | ` string ` | - |
63+ | ` placeholder ` | 输入框的占位提示 | ` string ` | - |
64+ | ` name ` | 输入框的 name | ` string ` | - |
65+ | ` html-type ` | 对应输入框的原生属性 ` type ` | ` string ` | ` text ` |
66+ | ` v-model ` | 双向绑定的值 | ` string \| number ` | - |
67+
68+ ### MdInput Expose
69+
70+ <!-- prettier-ignore -->
71+ | 方法名 | 说明 | 参数 | 返回值 |
72+ | --- | --- | --- | --- |
73+ | ` focus ` | 聚焦输入框 | - | - |
Original file line number Diff line number Diff line change 1212 "inspect:eslint" : " eslint --inspect-config"
1313 },
1414 "devDependencies" : {
15- "@types/node" : " ^22.0 .0" ,
16- "@typescript-eslint/eslint-plugin" : " ^7.17 .0" ,
17- "@typescript-eslint/parser" : " ^7.17 .0" ,
18- "@vitejs/plugin-vue" : " ^5.1.1 " ,
19- "eslint" : " ^9.8 .0" ,
15+ "@types/node" : " ^22.3 .0" ,
16+ "@typescript-eslint/eslint-plugin" : " ^8.1 .0" ,
17+ "@typescript-eslint/parser" : " ^8.1 .0" ,
18+ "@vitejs/plugin-vue" : " ^5.1.2 " ,
19+ "eslint" : " ^9.9 .0" ,
2020 "eslint-plugin-vue" : " ^9.27.0" ,
21- "globals" : " ^15.8 .0" ,
21+ "globals" : " ^15.9 .0" ,
2222 "prettier" : " ^3.3.3" ,
23- "shiki" : " ^1.12 .0" ,
23+ "shiki" : " ^1.13 .0" ,
2424 "typescript" : " ^5.5.4" ,
25- "vite" : " ^5.3.5 " ,
26- "vite-plugin-dts" : " 4.0.0-beta.1 " ,
27- "vitepress" : " ^1.3.1 " ,
25+ "vite" : " ^5.4.0 " ,
26+ "vite-plugin-dts" : " 4.0.3 " ,
27+ "vitepress" : " ^1.3.2 " ,
2828 "vue-tsc" : " ^2.0.29"
2929 },
3030 "peerDependencies" : {
6363 },
6464 "license" : " MulanPSL-2.0" ,
6565 "dependencies" : {
66- "@tanstack/vue-table" : " ^8.20.2 " ,
67- "ph-utils" : " ^0.8.2 " ,
66+ "@tanstack/vue-table" : " ^8.20.4 " ,
67+ "ph-utils" : " ^0.8.4 " ,
6868 "qrcode-generator-es" : " ^0.0.4" ,
69- "vue-router" : " ^4.4.0 "
69+ "vue-router" : " ^4.4.3 "
7070 },
7171 "packageManager" : " pnpm@9.0.2"
7272}
You can’t perform that action at this time.
0 commit comments