Open super-fool opened 5 years ago
freeze针对的是data. v-once针对的是component. 使用了freeze的对象,只有重新赋值才会改变。修改对象的值是没有用的。 使用了v-once的组件,修改对象和重新赋值都不会在该组件中改变,但是要记住对象是改变了,只不过没有在该组件中没有变化而已。
data
component
freeze针对的是
data
. v-once针对的是component
. 使用了freeze的对象,只有重新赋值才会改变。修改对象的值是没有用的。 使用了v-once的组件,修改对象和重新赋值都不会在该组件中改变,但是要记住对象是改变了,只不过没有在该组件中没有变化而已。