Paste the code first, then paste it directly to see the effect
-
{{ item.name }}
我出现了
I want to monitor whether the number under the list has changed or is greater than the current number.
If the number changes, the span below h2 will appear. Then it disappears in 1 second.
But I didn’t think about how to do it. (Note: Which span appears when the number changes. Not all appear.)
Good, you should use watch
It should be separated and used. I think the original Vue writing method should be like this:
You can go to https://jsfiddle.net/1rb586dr/2/ to experience it
You can use the
watch()
attributeI hope I can help you, if you still don’t understand, just
@me