MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / subscribe

Function subscribe

tech-study.js:1315–1333  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1313 const { onCreated, beforeCreat, onMounted, beforeMount } = options || {};
1314 // 订阅
1315 const subscribe = (e) => {
1316 const { onMounted, beforeMount } = e;
1317 if (beforeMount) {
1318 watch(beforemount, () => {
1319 if (beforemount.value) {
1320 beforeMount();
1321 return;
1322 }
1323 }, true);
1324 }
1325 if (onMounted) {
1326 watch(mounted, () => {
1327 if (mounted.value) {
1328 onMounted();
1329 return;
1330 }
1331 }, true);
1332 }
1333 };
1334 // 取消订阅
1335 const unsubscribe = (e) => {
1336 //懒得写

Callers 3

handleAttributeFunction · 0.70
handleChildrenFunction · 0.70
handleChangeElementFunction · 0.70

Calls 2

watchFunction · 0.70
onMountedFunction · 0.70

Tested by

no test coverage detected