javascript - vue2.0 beginners. Comprehension issues?
巴扎黑
巴扎黑 2017-07-05 10:37:44
0
1
811

1. Why can’t the value of this block be returned before it is instantiated?
2. Why can the value be returned only after instantiation?
3. The filter cannot be obtained directly from the prototype. Method? Why can’t it be used directly?

巴扎黑
巴扎黑

reply all(1)
習慣沉默

The Vue.filter method receives two parameters. The first parameter is the name of the filter, and the second parameter is the implementation of the filter. This static method is like telling me that there is a test filter, and the specific implementation is what you pass in. The second parameter, ok, I understand, I saved this filter globally, that’s all. If you want to call the test filter you passed in, you must instantiate it. During the instantiation process, the HTML template will be parsed. When you encounter {{1|test}} you wrote, OK, you know you need to call the test filter. , only then will the test filter be called and the value returned.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template