You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
558 B
30 lines
558 B
|
3 weeks ago
|
// 创建一个需要混入的对象
|
||
|
|
export const mixinstest = {
|
||
|
|
data () {
|
||
|
|
return {
|
||
|
|
testMix: '混入对象的data'
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onShow() {
|
||
|
|
this.account = '11111'
|
||
|
|
},
|
||
|
|
created () {
|
||
|
|
console.log('这是混入对象的created')
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
mixinsFun () {
|
||
|
|
console.log('调用混入对象的methods的函数')
|
||
|
|
}
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
testMix2 () {
|
||
|
|
return this.testMix + ':这是混入对象计算结果。'
|
||
|
|
}
|
||
|
|
},
|
||
|
|
watch: {
|
||
|
|
testMix (newVal, oldVal) {
|
||
|
|
console.log('混入对象的watch')
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|