【发布时间】:2021-02-15 04:04:46
【问题描述】:
在为 props 创建 ref 时如何获取正确的类型?我试过这样
setup(props) {
const { userId } = toRefs(props); // userId is string
retrun {
...getComposition(userId);
};
}
...
function getComposition(userId) {
// How to make sure that userId.value is string?)
const caps = userId.value.toUperCase(); // here how to get string method hints
}
【问题讨论】:
标签: typescript vue-composition-api