当前位置:网站首页>Mixin -- mixed
Mixin -- mixed
2022-06-10 10:32:00 【InfoQ】
Use
export let demo={
methods:{
fun(){
console.log(" Hello !!!!!!")
}
},
data(){
return {
}
},
computed:{
}
}call
The whole thing is in --mixin
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 1. quote mixin
import {demo} from "./mixins"
// 2. Configure global blending
Vue.mixin(demo)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
To mix in partially --mixins
<template>
<div class="about">
<h1>This is an about page</h1>
<!-- 3. You can use the mixed content as you want -->
<button @click="fun()"> Click on me to call the mixed method --{{text}}</button>
</div>
</template>
<script>
// 1. Reference blending
import {demo} from "@/mixins"
export default {
// 2. Call blending
mixins:[demo]
}
</script>
Custom instruction hook function
link : https://pan.baidu.com/s/14G-bpVthImHD4eosZUNSFA?pwd=yu27
Extraction code : yu27Open source address
边栏推荐
- 六、观察者模式
- "Great freehand flower and bird painting master Mr. likuchan" blockbuster digital collection launched in the whole network
- Dr. jiangxiaowei, a member of hpca Hall of fame, is the chief scientist of Dayu smart core
- Decorator mode
- 安装CocoaPods最新版教程
- [fishing artifact] UI library second to second lowcode tool - list part (II) small tool for maintaining JSON
- selenium分布式测试
- 2021 ciscn PWN preliminary
- NFT铸造交易平台开发市场详情
- PV操作每日一题-缓冲区问题(进阶版)
猜你喜欢
随机推荐
九、委托模式
Definition and use of the apipost environment variable
Neo hacker song's award-winning list has been announced. Who owns tens of thousands of dollars of gold?
Concurrent asyncio asynchronous programming
【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结
Random number letter (upper case) combination
PV操作每日一题-独木桥问题
[high concurrency] about optimistic lock and pessimistic lock, the interviewer of ant financial asked me these questions!!
Uncaught TypeError: Cannot read properties of undefined (reading ‘colspan‘)
Phpstrom télécharge le projet dans le cloud de code
PV操作每日一题-橘子苹果问题(高阶版)
Leetcode 1991. 找到数组的中间位置(暴力枚举)
效率工具 : uTools
工业互联网架构图
Selenium distributed testing
axure弹框设置
Detailed steps for installing mysql+django under mac
Qchart note 1: simple linear diagram lineseries
【并发编程JUC】创建线程的四种方式
"Great freehand flower and bird painting master Mr. likuchan" blockbuster digital collection launched in the whole network








