Skip to content

Commit

Permalink
Update Vue框架引入JS库的正确姿势.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wufenfen authored Apr 26, 2017
1 parent ba8950c commit e08b9fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Vue框架引入JS库的正确姿势.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
**entry.js**

import moment from 'moment';
Object.definePrototype(Vue.prototype, '$moment', { value: moment });
Object.defineProperty(Vue.prototype, '$moment', { value: moment });

由于所有的组件都会继承`Vue`原型对象上的方法,因此这些方法在任何组件文件中都能通过`this.$moment`访问到:

Expand Down

0 comments on commit e08b9fe

Please sign in to comment.