-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't get template ref when use dynamic component #4891
Comments
@edison1105 I also find this problem in 'product' mode, but everything works fine in 'dev' mode. From chrome F12, we can find |
@languanghao I will check it later. |
@languanghao |
@edison1105 PS: 看地区你也是中国的,用中文交流可以吗? |
@edison1105 I can reproduce the bug. When the dyanmic component ref to a component with top level Maybe the bug is here
When a component with top level await, |
@languanghao thanks for your demo and I made a online demo |
@languanghao there is a workaround, see #4930 (comment) |
@edison1105 thank you, I will try it. |
this demo at develepment env with options api can get ref, just at setup not work, but at production all work fine. why? "dependencies": {
"@ant-design/icons-vue": "^6.0.1",
"@vueuse/core": "^7.4.1",
"ant-design-vue": "^3.0.0-alpha.12",
"axios": "^0.24.0",
"core-js": "^3.8.3",
"vue": "^3.2.26",
"vue-clipboard3": "^1.0.1",
"vue-i18n": "^9.1.9",
"vue-router": "4",
"vue-shadow-dom": "^3.0.1",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/babel-plugin-jsx": "^1.1.1",
"@vue/cli-plugin-babel": "~5.0.1",
"@vue/cli-plugin-eslint": "~5.0.1",
"@vue/cli-plugin-typescript": "~5.0.1",
"@vue/cli-plugin-unit-jest": "~5.0.1",
"@vue/cli-service": "~5.0.1",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/test-utils": "^2.0.0-0",
"@vue/vue3-jest": "^27.0.0-alpha.1",
"babel-jest": "^27.0.6",
"babel-plugin-import": "^1.13.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"jest": "^27.1.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"patch-package": "^6.4.7",
"prettier": "^2.4.1",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"ts-jest": "^27.0.4",
"typescript": "~4.5.5"
} |
Version
3.2.21
Reproduction link
sfc.vuejs.org/
Steps to reproduce
click and will call child component's method
What is expected?
get dynamic instance with template ref
What is actually happening?
template ref return unexpected value:
comRef.value.test is not a function
The text was updated successfully, but these errors were encountered: