1、
const keywordValue = ref<any>({});
2、
const templateOptions = ref<{ label: string; value: string }[]>([]);
等同于
interface TemplateOption {
label: string;
value: string;
}
const templateOptions = ref<TemplateOption[]>([]);
templateOptions: [
{ lable: "", value: "" },
{ lable: "", value: "" },
{ lable: "", value: "" },
{ lable: "", value: "" },
],
3、
const formState = ref<{ [key: string]: any }>({
template: null, // 订阅模板
keywordValue: [], // 存放订阅的模板对应的表单项
});
等同于
interface FormState {
[key: string]: any;
}
const formState = ref<FormState>({});
v3结合ts积累
于 2023-11-24 10:35:07 首次发布