Why is the import name from ('') not allowed with a horizontal bar (-) when subcomponents are imported into the Vue component?

<script>
//  sub-vue
import sub-vue from "./component/sub.vue";
export default {
    data:function(){
        return {
            testStr:"is Test String"
        }
    },
    computed:{

    },
    filters:{

    },
    methods:{

    },
    components:{
    // key
        sub-vue:sub-vue
    },
    created:function(){

    },
    m
}
</script>
Mar.02,2022

ide/Grammar_and_types-sharpVariables" rel=" nofollow noreferrer "> https://developer.mozilla.org.
[-] is the operator


in my own understanding, import x from 'xxx' is equivalent to creating an x variable to receive export default objects in xxx files
then you can't var XMux in js, so you can't use' -'in import

.

scratch

Menu