如图所示,“aliyun.value [key]”会报类型错误,但我修改代码时没有任何警告,如下所示针对我的案例,更规范的写法是什么?
// Define the specific type for a ref.
const aliyun = ref<{ [key: string]: string }>({
name: "aliyun",
access_key_id: "",
access_key_secret: "",
sign_name: ""
});
如图所示,“aliyun.value [key]”会报类型错误,但我修改代码时没有任何警告,如下所示针对我的案例,更规范的写法是什么?
// Define the specific type for a ref.
const aliyun = ref<{ [key: string]: string }>({
name: "aliyun",
access_key_id: "",
access_key_secret: "",
sign_name: ""
});
1条答案
按热度按时间wgx48brx1#