Vue官方文档(34):混入,组件本身的属性优先级高于混入
发布时间:2022-11-08 13:06:10 368 相关标签: # webkit
<template>
<div >
{{message}}
</div>
</template>
<script>
//import Vue from 'vue'
var mixin = {
data: function () {
return {
message: 'hello',
foo: 'abc'
}
}
}
export default{
mixins: [mixin]
,
components: {
},
data() {
return {
message: 'goodby',
bar: 'def'
}
},
methods:{
},
created(){
console.log(JSON.stringify(this.$data))
// => { message: "goodbye", foo: "abc", bar: "def" }
},
computed: {
},
watch: {
}
}
</script>
<style >
</style>
文章来源: https://blog.51cto.com/amadeusliu/5825270
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报