Skip to content

Commit

Permalink
feat: 新增编辑表单
Browse files Browse the repository at this point in the history
  • Loading branch information
shinetingli committed Jan 20, 2023
1 parent 9a61f4b commit e9aa8a1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/TingShine"
},
"repository": {
"url": ""
"url": "https://github.com/TingShine/vue-draggable-tree-next"
},
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -45,5 +45,8 @@
"vite-svg-loader": "^4.0.0",
"vitest": "^0.25.6",
"vue-tsc": "^1.0.12"
},
"peerDependencies": {
"tdesign-vue-next": "^1.0.4"
}
}
27 changes: 27 additions & 0 deletions src/components/cascader-input/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div>
<t-select
v-model="type"
:options="options"
placeholder="请选择值类型"
@change="handleSelectType"
></t-select>
<input-field v-if="type" :type="type"></input-field>
</div>
</template>

<script lang="ts" setup>
import { Select as TSelect, type SelectValue } from "tdesign-vue-next";
import { ref } from "vue";
import { cascaderSelectOptions } from "@/utils/config";
import InputField from '../input-field/index.vue';
const options = ref(cascaderSelectOptions);
const type = ref("");
const handleSelectType = (value: SelectValue) => {
// switch(value) {
// case 'Number'
// }
}
</script>
6 changes: 6 additions & 0 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const cascaderSelectOptions = [
{ label: "字符串", value: "String" },
{ label: "数值", value: "Number" },
{ label: "布尔值", value: "Boolean" },
{ label: "随机值", value: "Random" },
];

0 comments on commit e9aa8a1

Please sign in to comment.