I am just trying to convert a third party vue.js plugin (polygoncropper) to reactjs component in my reactjs application. I have abit changed the plugin and pushed the codes to my repository
I then build the plugin by using
vue-cli-service build --target wc --name my-app src/App.vue
There is no issue with generated html and js files and I can sucessfuly run the plugin by the js generated file, however I am not sure how to use that inside my react application
I am just using the generated script (js file inside dis folder) like below inside my react application
import "components/PolygonCropper/my-app.js";
I am getting below error when I compile my react.js application
Failed to compile.
./src/components/PolygonCropper/my-app.js
Line 139:4: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 3990:475: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 3990:1058: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 3990:1238: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 3990:1435: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 37299:5: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 37304:10: Unexpected use of 'self' no-restricted-globals
Line 37304:33: Unexpected use of 'self' no-restricted-globals
Line 37388:18: 'Vue' is not defined no-undef
Line 37949:16: Unexpected use of 'self' no-restricted-globals
Line 37949:36: Unexpected use of 'self' no-restricted-globals
Can you help me convert that vue.js plugin to a react component successfully?
question from:
https://stackoverflow.com/questions/65623194/converting-a-vue-js-plugin-to-react-js-component 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…