Skip to content

./src/main.js use import Vue from 'vue' why is not import * as Vue from 'vue' #985

@biluochun

Description

@biluochun

MDN-import

vue.js/dist/vue.js

(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global.Vue = factory());
}(this, (function () {});

./src/main.js:

import Vue from 'vue'
import App from './App'
import router from './router'

I think
vue inside the export is module.exports = Vue;
The correct reference should be import * as Vue from 'vue';

Only export to module.exports = Vue; Vue.default = Vue; or export default Vue;
Reference is import Vue from 'vue';


update:

is it a vue issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions