Why do subcomponents not need import vue? when using vue

Why do subcomponents not need import vue? when using vue

Apr.05,2021

if you are based on vue-cli,webpack engineering development, using the kind of .vue file suffix for the file, this mode, there will be a vue-loader , the JavaScript code in your vue file is extracted, vue is already in these extracted code, you do not need to manually import vue , it is all thanks to vue-loader .


introduced


vue in webpack to match


since it is a sub-component, it means that the root component has introduced vue;
you try to comment out the import vue of the root component and see if it still works?
Vue-loader just precompiles the components into render function code;
if you write vue directly without vue-cli, you will understand.
as to why subcomponents don't reference vue, my answer is that the root component is already referenced.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb1779-2350.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb1779-2350.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?