/** * 顶部header */ Vue.component("people-number", { template: `
{{unit}}
`, props: { number: { type: Number, }, unit:{ type:String } }, data() { return { people:[] } }, mounted(){ this.init() }, methods: { init(){ this.setData() }, setData(){ var people = this.number != undefined?this.number.toString().split(''):0; this.people = people } }, watch:{ number: function (n,o) { this.init() } } })