How to use mixin blending in Vue
This article mainly introduces how to mix mixin in Vue, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Partially mix student name: {{name}} student gender: {{sex}} / / introduce a mixed import {hunhe,hunhe2} from'. / mixin' export default {name: 'Student', data () {return {name:' Zhang San', sex: 'male'}}, mixins: [hunhe Hunhe2]} export const hunhe = {methods: {showName () {alert (this.name)}} export const hunhe2 = {data () {return {x: 100,y: 200} globally mix import {hunhe, hunhe2} from'. / mixin'Vue.mixin (hunhe) Vue.mixin (hunhe2)
Thank you for reading this article carefully. I hope the article "how to mix mixin in Vue" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!