-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/2024_fisrt_version'
- Loading branch information
Showing
13 changed files
with
97 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, { useEffect } from 'react' | ||
|
||
|
||
const myReactComponent = class A extends React.Component { | ||
componentWillUnmount() { | ||
console.log(1111, document.querySelector(".aaa")) | ||
console.log(2222, document.querySelector(".bbb")) | ||
} | ||
render() { | ||
return (<div> | ||
<div className="aaa">unMountTest</div> | ||
</div>) | ||
} | ||
} | ||
|
||
export default myReactComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import '@testing-library/jest-dom'; | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/vue'; | ||
import Component from "./4-reactUnMount.vue" | ||
|
||
test('test reactUnMount', async () => { | ||
render(Component); | ||
await new Promise(resolve => { | ||
setTimeout(resolve, 300); | ||
}) | ||
const linkElement = await screen.findByText(/reactUnMountSuccess/); | ||
expect(linkElement).toBeInTheDocument() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<ReactComponentInVue v-if="showFlag"/> | ||
</template> | ||
|
||
<script> | ||
import {h, ref, onMounted} from 'vue' | ||
import {applyReactInVue} from 'veaury' | ||
import ReactComponent from "./react_app/ReactUnMount" | ||
export default { | ||
components: { | ||
ReactComponentInVue: applyReactInVue(ReactComponent) | ||
}, | ||
setup() { | ||
const showFlag = ref(true) | ||
onMounted(() => { | ||
setTimeout(() => { | ||
showFlag.value = false | ||
}, 200); | ||
}) | ||
return { | ||
showFlag | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useEffect } from 'react' | ||
export default class A extends React.Component { | ||
componentWillUnmount() { | ||
const foundDom = document.querySelector(".aaa") | ||
const notFoundDom = document.querySelector(".bbb") | ||
if (foundDom && !notFoundDom) { | ||
document.body.appendChild(document.createTextNode("reactUnMountSuccess")) | ||
} | ||
} | ||
render() { | ||
return (<div> | ||
<div className="aaa">unMountTest</div> | ||
</div>) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters