doway-coms 1.4.91 → 1.4.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/package.json +52 -52
  4. package/packages/BaseButton/index.js +7 -7
  5. package/packages/BaseButton/src/index.vue +241 -241
  6. package/packages/BaseCheckbox/index.js +7 -7
  7. package/packages/BaseCheckbox/src/index.vue +134 -134
  8. package/packages/BaseDate/index.js +7 -7
  9. package/packages/BaseDate/src/index.vue +197 -197
  10. package/packages/BaseDateWeek/index.js +7 -7
  11. package/packages/BaseDateWeek/src/index.vue +163 -163
  12. package/packages/BaseDatetime/index.js +7 -7
  13. package/packages/BaseDatetime/src/index.vue +196 -196
  14. package/packages/BaseForm/index.js +7 -7
  15. package/packages/BaseForm/src/index.vue +664 -664
  16. package/packages/BaseGantt/index.js +9 -9
  17. package/packages/BaseGantt/src/index.vue +604 -604
  18. package/packages/BaseGrid/index.js +9 -9
  19. package/packages/BaseGrid/src/index.vue +2674 -2674
  20. package/packages/BaseGridAdjust/index.js +9 -9
  21. package/packages/BaseGridAdjust/src/index.vue +455 -455
  22. package/packages/BaseInput/index.js +7 -7
  23. package/packages/BaseInput/src/index.vue +164 -164
  24. package/packages/BaseIntervalInput/index.js +7 -7
  25. package/packages/BaseIntervalInput/src/index.vue +310 -310
  26. package/packages/BaseKanbanEmpty/index.js +7 -7
  27. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  28. package/packages/BaseNumberInput/index.js +7 -7
  29. package/packages/BaseNumberInput/src/index.vue +229 -229
  30. package/packages/BasePagination/index.js +7 -7
  31. package/packages/BasePagination/src/index.vue +91 -91
  32. package/packages/BasePictureCard/index.js +7 -7
  33. package/packages/BasePictureCard/src/index.vue +561 -561
  34. package/packages/BasePrintPreview/index.js +7 -7
  35. package/packages/BasePrintPreview/src/index.vue +117 -117
  36. package/packages/BasePulldown/index.js +7 -7
  37. package/packages/BasePulldown/src/index.vue +829 -829
  38. package/packages/BaseSearch/index.js +7 -7
  39. package/packages/BaseSearch/src/index.vue +935 -935
  40. package/packages/BaseSelect/index.js +7 -7
  41. package/packages/BaseSelect/src/index.vue +153 -153
  42. package/packages/BaseSelectMulti/index.js +7 -7
  43. package/packages/BaseSelectMulti/src/index.vue +148 -148
  44. package/packages/BaseTextArea/index.js +7 -7
  45. package/packages/BaseTextArea/src/index.vue +178 -178
  46. package/packages/BaseTime/index.js +7 -7
  47. package/packages/BaseTime/src/index.vue +166 -166
  48. package/packages/BaseTool/index.js +7 -7
  49. package/packages/BaseTool/src/index.vue +349 -349
  50. package/packages/BaseToolStatus/index.js +7 -7
  51. package/packages/BaseToolStatus/src/index.vue +383 -383
  52. package/packages/index.js +165 -165
  53. package/packages/styles/default.less +80 -80
  54. package/packages/utils/api.js +45 -45
  55. package/packages/utils/auth.js +38 -38
  56. package/packages/utils/common.js +583 -583
  57. package/packages/utils/dom.js +181 -181
  58. package/packages/utils/enum.js +83 -83
  59. package/packages/utils/filters.js +458 -458
  60. package/packages/utils/gridFormat.js +52 -52
  61. package/packages/utils/msg.js +16 -16
  62. package/packages/utils/patchFiles.js +44 -44
  63. package/packages/utils/request.js +169 -169
  64. package/packages/utils/store.js +246 -246
  65. package/vue.config.js +59 -59
  66. package/dist/css/chunk-vendors.7f83d8f9.css +0 -8
  67. package/dist/css/index.86478f73.css +0 -3
  68. package/dist/favicon.ico +0 -0
  69. package/dist/js/chunk-vendors.307eaa8f.js +0 -347
  70. package/dist/js/index.48e7f7ac.js +0 -2
@@ -1,247 +1,247 @@
1
-
2
- import {loadViewInfo} from './api'
3
- import XEUtils from 'xe-utils'
4
- import Vue from 'vue'
5
- import Vuex from 'vuex'
6
- import {stringUrlQuery} from './common'
7
- import { controlType } from './enum'
8
- Vue.use(Vuex)
9
-
10
- export default new Vuex.Store({
11
- state: {
12
- umsUrl:'',
13
- msgUrl:'',
14
- identityUrl:'',
15
- token: '',
16
- industryVersion:'',//行业版本
17
- custPriceNotTaxPrecision:0,
18
- custPricePrecision:0,
19
- supplyPriceNotTaxPrecision:0,
20
- supplyPricePrecision:0,
21
- isGenerateMatCode:'false',//是否生成物料编码
22
- webAppCode: '',
23
- moduleViewInfo: {},
24
- controlSize: 'small',
25
- newId: 0,//明细新增id
26
- userId: '',
27
- userName: '',
28
- staffId: '',
29
- },
30
- mutations: {
31
- SET_TOKEN: (state, token) => {
32
- state.token = token
33
- },
34
- SET_USERID: (state, userId) => {
35
- state.userId = userId
36
- },
37
- SET_USERNAME: (state, userName) => {
38
- state.userName = userName
39
- },
40
- SET_STAFFID: (state, staffId) => {
41
- state.staffId = staffId
42
- },
43
- SET_INDUSTRY_VERSION:(state,industryVersion)=>{
44
- state.industryVersion = industryVersion
45
- },
46
- SET_IS_GENERATE_MAT_CODE:(state,isGenerateMatCode)=>{
47
- state.isGenerateMatCode = isGenerateMatCode
48
- },
49
- SET_WEB_APP_CODE: (state, webAppCode) => {
50
- state.webAppCode = webAppCode
51
- },
52
- SET_MODULE_VIEW_INFO: (state, data) => {
53
- let tempDataInfo = {}
54
- XEUtils.arrayEach(data.info.datas,loopData=>{
55
- let tempFields = []
56
- let tempPagerButtons = []
57
- tempDataInfo[loopData.code] = {code:'',name:'',fields:[]}
58
- tempDataInfo[loopData.code].code = loopData.code
59
- tempDataInfo[loopData.code].name = loopData.name
60
- let operationFields = []
61
- XEUtils.arrayEach(loopData.fields,loopField=>{
62
- let tempField = {
63
- field: loopField.boundField,
64
- title: loopField.name,
65
- width: loopField.width,
66
- visible: !loopField.hidden,
67
- filters: loopField.isFilter,
68
- sortable: loopField.isSortable,
69
- controlType: loopField.controlType,
70
- edit:loopField.edit
71
- }
72
- //页面状态控制
73
- if(loopField.editStates){
74
- tempField['editStates'] = loopField.editStates.split(',')
75
- }
76
- //单据状态控制
77
- if(loopField.editStatuss){
78
- tempField['editStatuss'] = loopField.editStatuss.split(',')
79
- }
80
- let extraInfo = loopField.extraInfo
81
- ? JSON.parse(loopField.extraInfo)
82
- : ''
83
- //存在额外参数,就赋值
84
- if(extraInfo){
85
- tempField = XEUtils.assign(extraInfo,tempField)
86
- }
87
- if (tempField.controlType === controlType.select) {
88
- tempField['dataSource'] = XEUtils.filter(
89
- data.info.dictItems,
90
- p => p.dictCode === extraInfo.dataSource
91
- )
92
- }
93
-
94
- if(tempField.controlType === controlType.pager_button){
95
- tempPagerButtons.push(tempField)
96
- }else if(tempField.controlType===controlType.operation){
97
- //操作按钮列
98
- operationFields.push(tempField)
99
-
100
- }
101
- else{
102
- tempFields.push(tempField)
103
- }
104
- })
105
-
106
- tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
107
- if(operationFields.length>0){
108
- //添加右侧按钮操作列
109
- tempFields.push({
110
- field: controlType.operation,
111
- title: '操作',
112
- width: 100,
113
- fixed: 'right',
114
- showOverflow: true,
115
- controlType: controlType.operation,
116
- params:{
117
- columns:operationFields
118
- }
119
- })
120
- }
121
- tempDataInfo[loopData.code]['fields'] = tempFields
122
-
123
- })
124
- data.info['dataInfo'] = tempDataInfo
125
- state.moduleViewInfo[data.moduleCode] = data.info
126
- },
127
- SET_NEW_ID: (state, id) => {
128
- state.newId = id
129
- },
130
- SET_UMS_URL:(state,url) => {
131
- state.umsUrl = url
132
- },
133
- SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
134
- state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
135
- },
136
- SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
137
- state.custPricePrecision = custPricePrecision
138
- },
139
- SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
140
- state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
141
- },
142
- SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
143
- state.supplyPricePrecision = supplyPricePrecision
144
- },
145
- SET_MSG_URL:(state,url) => {
146
- state.msgUrl = url
147
- },
148
- SET_IDENTITY_URL:(state,url) => {
149
- state.identityUrl = url
150
- },
151
- },
152
- actions: {
153
- /**
154
- * 系统登出
155
- * @param {} param0
156
- */
157
- logOut({commit}){
158
- // alert('会话过期3');
159
- if(window.$wujie){
160
- // alert('会话过期4');
161
- //通知主应用会员过期重新登陆
162
- window.$wujie.bus.$emit(
163
- 'subAppLoginOut',window.$wujie.props.webAppCode
164
- )
165
- }
166
- },
167
- setTabTitle({ commit }, tabInfo) {
168
- if (tabInfo.replaceQuery) {
169
- let newRoutePath =
170
- tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
171
- history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
172
- }
173
- //通知父应用修改Tab标签文字描述
174
- if(window.$wujie){
175
- window.$wujie.bus.$emit('subAppSetTabTitle', {
176
- title: tabInfo.title,
177
- name: tabInfo.name,
178
- query: tabInfo.query,
179
- replaceQuery: tabInfo.replaceQuery,
180
- path: tabInfo.path
181
- })
182
- }
183
- },
184
- closeTab({ commit }, fullPath) {
185
- if(window.$wujie){
186
- window.$wujie.bus.$emit(
187
- 'subAppCloseTab',
188
- window.$wujie.props.webAppActiveRule + fullPath
189
- )
190
- }
191
- },
192
- moduleLoadViewInfo({ commit, state }, dataInfo) {
193
- let vm = this
194
- return new Promise((resolve, reject) => {
195
- loadViewInfo(dataInfo.moduleCode)
196
- .then(reponseData => {
197
- commit('SET_MODULE_VIEW_INFO', {
198
- moduleCode: dataInfo.moduleCode,
199
- info: reponseData.content
200
- })
201
- resolve()
202
- })
203
- .catch(error => {
204
- reject(error)
205
- })
206
- })
207
- },
208
- // 固定返回工作台,并根据条件决定是否关闭其余标签
209
- goWorkbench({ commit }, tabsAllClose) {
210
- if(window.$wujie){
211
- window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
212
- }
213
- },
214
- // 替换页面
215
- replaceTab({ commit }, fullPath) {
216
- if(window.$wujie){
217
- window.$wujie.bus.$emit(
218
- 'subAppReplaceTab',
219
- window.$wujie.props.webAppActiveRule + fullPath
220
- )
221
- }
222
- },
223
- },
224
- modules:{},
225
- getters: {
226
- custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
227
- custPricePrecision:state=>state.custPricePrecision,
228
- supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
229
- supplyPricePrecision:state=>state.supplyPricePrecision,
230
- industryVersion:state=>state.industryVersion,
231
- isGenerateMatCode:state=>state.isGenerateMatCode,
232
- umsUrl:state=>state.umsUrl,
233
- msgUrl:state=>state.msgUrl,
234
- identityUrl:state=>state.identityUrl,
235
- token: state => state.token,
236
- webAppCode: state => state.webAppCode,
237
- moduleViewInfo: state => state.moduleViewInfo,
238
- controlSize: state => state.controlSize,
239
- newId: state => () => {
240
- state.newId = state.newId + 1
241
- return state.newId
242
- },
243
- userId: state => state.userId,
244
- userName: state => state.userName,
245
- staffId: state => state.staffId,
246
- }
1
+
2
+ import {loadViewInfo} from './api'
3
+ import XEUtils from 'xe-utils'
4
+ import Vue from 'vue'
5
+ import Vuex from 'vuex'
6
+ import {stringUrlQuery} from './common'
7
+ import { controlType } from './enum'
8
+ Vue.use(Vuex)
9
+
10
+ export default new Vuex.Store({
11
+ state: {
12
+ umsUrl:'',
13
+ msgUrl:'',
14
+ identityUrl:'',
15
+ token: '',
16
+ industryVersion:'',//行业版本
17
+ custPriceNotTaxPrecision:0,
18
+ custPricePrecision:0,
19
+ supplyPriceNotTaxPrecision:0,
20
+ supplyPricePrecision:0,
21
+ isGenerateMatCode:'false',//是否生成物料编码
22
+ webAppCode: '',
23
+ moduleViewInfo: {},
24
+ controlSize: 'small',
25
+ newId: 0,//明细新增id
26
+ userId: '',
27
+ userName: '',
28
+ staffId: '',
29
+ },
30
+ mutations: {
31
+ SET_TOKEN: (state, token) => {
32
+ state.token = token
33
+ },
34
+ SET_USERID: (state, userId) => {
35
+ state.userId = userId
36
+ },
37
+ SET_USERNAME: (state, userName) => {
38
+ state.userName = userName
39
+ },
40
+ SET_STAFFID: (state, staffId) => {
41
+ state.staffId = staffId
42
+ },
43
+ SET_INDUSTRY_VERSION:(state,industryVersion)=>{
44
+ state.industryVersion = industryVersion
45
+ },
46
+ SET_IS_GENERATE_MAT_CODE:(state,isGenerateMatCode)=>{
47
+ state.isGenerateMatCode = isGenerateMatCode
48
+ },
49
+ SET_WEB_APP_CODE: (state, webAppCode) => {
50
+ state.webAppCode = webAppCode
51
+ },
52
+ SET_MODULE_VIEW_INFO: (state, data) => {
53
+ let tempDataInfo = {}
54
+ XEUtils.arrayEach(data.info.datas,loopData=>{
55
+ let tempFields = []
56
+ let tempPagerButtons = []
57
+ tempDataInfo[loopData.code] = {code:'',name:'',fields:[]}
58
+ tempDataInfo[loopData.code].code = loopData.code
59
+ tempDataInfo[loopData.code].name = loopData.name
60
+ let operationFields = []
61
+ XEUtils.arrayEach(loopData.fields,loopField=>{
62
+ let tempField = {
63
+ field: loopField.boundField,
64
+ title: loopField.name,
65
+ width: loopField.width,
66
+ visible: !loopField.hidden,
67
+ filters: loopField.isFilter,
68
+ sortable: loopField.isSortable,
69
+ controlType: loopField.controlType,
70
+ edit:loopField.edit
71
+ }
72
+ //页面状态控制
73
+ if(loopField.editStates){
74
+ tempField['editStates'] = loopField.editStates.split(',')
75
+ }
76
+ //单据状态控制
77
+ if(loopField.editStatuss){
78
+ tempField['editStatuss'] = loopField.editStatuss.split(',')
79
+ }
80
+ let extraInfo = loopField.extraInfo
81
+ ? JSON.parse(loopField.extraInfo)
82
+ : ''
83
+ //存在额外参数,就赋值
84
+ if(extraInfo){
85
+ tempField = XEUtils.assign(extraInfo,tempField)
86
+ }
87
+ if (tempField.controlType === controlType.select) {
88
+ tempField['dataSource'] = XEUtils.filter(
89
+ data.info.dictItems,
90
+ p => p.dictCode === extraInfo.dataSource
91
+ )
92
+ }
93
+
94
+ if(tempField.controlType === controlType.pager_button){
95
+ tempPagerButtons.push(tempField)
96
+ }else if(tempField.controlType===controlType.operation){
97
+ //操作按钮列
98
+ operationFields.push(tempField)
99
+
100
+ }
101
+ else{
102
+ tempFields.push(tempField)
103
+ }
104
+ })
105
+
106
+ tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
107
+ if(operationFields.length>0){
108
+ //添加右侧按钮操作列
109
+ tempFields.push({
110
+ field: controlType.operation,
111
+ title: '操作',
112
+ width: 100,
113
+ fixed: 'right',
114
+ showOverflow: true,
115
+ controlType: controlType.operation,
116
+ params:{
117
+ columns:operationFields
118
+ }
119
+ })
120
+ }
121
+ tempDataInfo[loopData.code]['fields'] = tempFields
122
+
123
+ })
124
+ data.info['dataInfo'] = tempDataInfo
125
+ state.moduleViewInfo[data.moduleCode] = data.info
126
+ },
127
+ SET_NEW_ID: (state, id) => {
128
+ state.newId = id
129
+ },
130
+ SET_UMS_URL:(state,url) => {
131
+ state.umsUrl = url
132
+ },
133
+ SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
134
+ state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
135
+ },
136
+ SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
137
+ state.custPricePrecision = custPricePrecision
138
+ },
139
+ SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
140
+ state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
141
+ },
142
+ SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
143
+ state.supplyPricePrecision = supplyPricePrecision
144
+ },
145
+ SET_MSG_URL:(state,url) => {
146
+ state.msgUrl = url
147
+ },
148
+ SET_IDENTITY_URL:(state,url) => {
149
+ state.identityUrl = url
150
+ },
151
+ },
152
+ actions: {
153
+ /**
154
+ * 系统登出
155
+ * @param {} param0
156
+ */
157
+ logOut({commit}){
158
+ // alert('会话过期3');
159
+ if(window.$wujie){
160
+ // alert('会话过期4');
161
+ //通知主应用会员过期重新登陆
162
+ window.$wujie.bus.$emit(
163
+ 'subAppLoginOut',window.$wujie.props.webAppCode
164
+ )
165
+ }
166
+ },
167
+ setTabTitle({ commit }, tabInfo) {
168
+ if (tabInfo.replaceQuery) {
169
+ let newRoutePath =
170
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
171
+ history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
172
+ }
173
+ //通知父应用修改Tab标签文字描述
174
+ if(window.$wujie){
175
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
176
+ title: tabInfo.title,
177
+ name: tabInfo.name,
178
+ query: tabInfo.query,
179
+ replaceQuery: tabInfo.replaceQuery,
180
+ path: tabInfo.path
181
+ })
182
+ }
183
+ },
184
+ closeTab({ commit }, fullPath) {
185
+ if(window.$wujie){
186
+ window.$wujie.bus.$emit(
187
+ 'subAppCloseTab',
188
+ window.$wujie.props.webAppActiveRule + fullPath
189
+ )
190
+ }
191
+ },
192
+ moduleLoadViewInfo({ commit, state }, dataInfo) {
193
+ let vm = this
194
+ return new Promise((resolve, reject) => {
195
+ loadViewInfo(dataInfo.moduleCode)
196
+ .then(reponseData => {
197
+ commit('SET_MODULE_VIEW_INFO', {
198
+ moduleCode: dataInfo.moduleCode,
199
+ info: reponseData.content
200
+ })
201
+ resolve()
202
+ })
203
+ .catch(error => {
204
+ reject(error)
205
+ })
206
+ })
207
+ },
208
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
209
+ goWorkbench({ commit }, tabsAllClose) {
210
+ if(window.$wujie){
211
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
212
+ }
213
+ },
214
+ // 替换页面
215
+ replaceTab({ commit }, fullPath) {
216
+ if(window.$wujie){
217
+ window.$wujie.bus.$emit(
218
+ 'subAppReplaceTab',
219
+ window.$wujie.props.webAppActiveRule + fullPath
220
+ )
221
+ }
222
+ },
223
+ },
224
+ modules:{},
225
+ getters: {
226
+ custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
227
+ custPricePrecision:state=>state.custPricePrecision,
228
+ supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
229
+ supplyPricePrecision:state=>state.supplyPricePrecision,
230
+ industryVersion:state=>state.industryVersion,
231
+ isGenerateMatCode:state=>state.isGenerateMatCode,
232
+ umsUrl:state=>state.umsUrl,
233
+ msgUrl:state=>state.msgUrl,
234
+ identityUrl:state=>state.identityUrl,
235
+ token: state => state.token,
236
+ webAppCode: state => state.webAppCode,
237
+ moduleViewInfo: state => state.moduleViewInfo,
238
+ controlSize: state => state.controlSize,
239
+ newId: state => () => {
240
+ state.newId = state.newId + 1
241
+ return state.newId
242
+ },
243
+ userId: state => state.userId,
244
+ userName: state => state.userName,
245
+ staffId: state => state.staffId,
246
+ }
247
247
  })
package/vue.config.js CHANGED
@@ -1,60 +1,60 @@
1
- // vue.config.js 文件
2
- // const ExtractTextPlugin = require('extract-text-webpack-plugin')
3
- const path = require('path')
4
- function resolve(dir) {
5
- return path.join(__dirname, dir)
6
- }
7
- module.exports = {
8
- pages: {
9
- index: {
10
- entry: "examples/main.js",
11
- template: "public/index.html",
12
- filename: "index.html"
13
- }
14
- },
15
- // configureWebpack: () => {
16
- // new ExtractTextPlugin('libs/test.css')
17
- // },
18
- // css: {
19
- // extract: true, // 是否使用css分离插件 ExtractTextPlugin
20
- // sourceMap: false, // 开启 CSS source maps?
21
- // // loaderOptions: {
22
- // // less: {
23
- // // javascriptEnabled: true //less 配置
24
- // // }
25
- // // }, // css预设器配置项
26
- // modules: false // 启用 CSS modules for all css / pre-processor files.
27
- // },
28
- // 扩展 webpack 配置,使 packages 加入编译
29
- /* chainWebpack 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。容许对内部的 webpack 配置进行更细粒度的修改。 */
30
- chainWebpack: config => {
31
- config.plugins.delete('preload') // TODO: need test
32
- config.plugins.delete('prefetch') // TODO: need test
33
- config.resolve.alias.set('../../tools/dom', resolve('packages/utils/dom.js'))
34
- // config.module.rule('/\.less$/').use(ExtractTextPlugin.extract({
35
- // fallback:'vue-style-loader',
36
- // use:['css-loader',
37
- // 'less-loader']
38
- // })).loader('less-loader','css-loader')
39
-
40
-
41
-
42
- config.module
43
- .rule('js')
44
- .include
45
- .add(__dirname + 'packages') // 注意这里须要绝对路径,全部要拼接__dirname
46
- .end()
47
- .use('babel')
48
- .loader('babel-loader')
49
- .tap(options => {
50
- // 修改它的选项...
51
- return options
52
- })
53
-
54
-
55
- }
56
- }
57
-
58
-
59
-
1
+ // vue.config.js 文件
2
+ // const ExtractTextPlugin = require('extract-text-webpack-plugin')
3
+ const path = require('path')
4
+ function resolve(dir) {
5
+ return path.join(__dirname, dir)
6
+ }
7
+ module.exports = {
8
+ pages: {
9
+ index: {
10
+ entry: "examples/main.js",
11
+ template: "public/index.html",
12
+ filename: "index.html"
13
+ }
14
+ },
15
+ // configureWebpack: () => {
16
+ // new ExtractTextPlugin('libs/test.css')
17
+ // },
18
+ // css: {
19
+ // extract: true, // 是否使用css分离插件 ExtractTextPlugin
20
+ // sourceMap: false, // 开启 CSS source maps?
21
+ // // loaderOptions: {
22
+ // // less: {
23
+ // // javascriptEnabled: true //less 配置
24
+ // // }
25
+ // // }, // css预设器配置项
26
+ // modules: false // 启用 CSS modules for all css / pre-processor files.
27
+ // },
28
+ // 扩展 webpack 配置,使 packages 加入编译
29
+ /* chainWebpack 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。容许对内部的 webpack 配置进行更细粒度的修改。 */
30
+ chainWebpack: config => {
31
+ config.plugins.delete('preload') // TODO: need test
32
+ config.plugins.delete('prefetch') // TODO: need test
33
+ config.resolve.alias.set('../../tools/dom', resolve('packages/utils/dom.js'))
34
+ // config.module.rule('/\.less$/').use(ExtractTextPlugin.extract({
35
+ // fallback:'vue-style-loader',
36
+ // use:['css-loader',
37
+ // 'less-loader']
38
+ // })).loader('less-loader','css-loader')
39
+
40
+
41
+
42
+ config.module
43
+ .rule('js')
44
+ .include
45
+ .add(__dirname + 'packages') // 注意这里须要绝对路径,全部要拼接__dirname
46
+ .end()
47
+ .use('babel')
48
+ .loader('babel-loader')
49
+ .tap(options => {
50
+ // 修改它的选项...
51
+ return options
52
+ })
53
+
54
+
55
+ }
56
+ }
57
+
58
+
59
+
60
60