Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use mixin blending in Vue

Shulou Source: shulou.com Published: 2022-06-02 12:37:49 11月16日 Update

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!

Tags: Articles students value overall situation interest at the same time name part gender more friends knowledge editing industry information information channels channels Zhang San reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Apple Redmi OPPO Reno Shulou Technology