Vue3 组件常用API封装

目录结构:

 

1、插件:instance

import {
	ref,
	reactive,
	watch,
	computed,
	onMounted,
	getCurrentInstance
} from "vue";
export default function() {
	let {proxy} = getCurrentInstance();
	console.log(proxy);
	proxy.ref=ref
	proxy.reactive=reactive
	proxy.watch=watch
	proxy.computed=computed
	proxy.onMounted=onMounted
	return proxy
}

2、父组件:layout


3、子组件filter:






你可能感兴趣的:(vue,vue.js,javascript,前端)