为什么不是 ref 中的value
来源:10-13 商家详情页分类及内容联动的实现

All_Good
2021-05-15
老师,您好! currentTab 在 ref 中,进行 value 赋值的时候,是通过 currentTab.value 赋值;
为什么在 HTML 使用的时候,不是通过 currentTab.value === catItem.tab, 而是 currentTab === catItem.tab??
vue.js 官网是说返回的是一个 reactive and mutable ref object, catItem.tab 也是一个object? 不是一个 String 吗? catogories 中的一个tab的value
Takes an inner value and returns a reactive and mutable ref object. The ref object has a single property .value that points to the inner value.
写回答
1回答
-
Dell
2021-05-16
html 中,你说的实际是模版中,模版中会自动帮你抹平.value 这种语法,你不写底层它会帮你去找
112021-05-16
相似问题