我有这样一个包,结构如下index.jsimport apiList from './interface'const install = Vue => { if (install.installed) return;
install.installed = true
Object.defineProperties(Vue.prototype, {
api: { get() { return apiList }
}
})
}export default install当在我这样引入包能正常运行import api from '@/assets/js/http/index'但是这样就不行import api from '@/assets/js/http'不是说 webpack 引入包名,会自动找 index.js 或 package.json的main字段吗?但是我这里直接引入包名'@/assets/js/http'无效是什么问题?
添加回答
举报
0/150
提交
取消
