doway-coms 1.5.5 → 1.5.7

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 (74) 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 +2690 -2693
  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 +867 -867
  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 +257 -251
  65. package/vue.config.js +59 -59
  66. package/dist/css/chunk-vendors.7f83d8f9.css +0 -8
  67. package/dist/css/index.7946d50b.css +0 -1
  68. package/dist/favicon.ico +0 -0
  69. package/dist/js/chunk-vendors.28fda91d.js +0 -340
  70. package/dist/js/index.49bc6add.js +0 -2
  71. package/lib/doway-coms.common.js +0 -120397
  72. package/lib/doway-coms.css +0 -1
  73. package/lib/doway-coms.umd.js +0 -120407
  74. package/lib/doway-coms.umd.min.js +0 -328
@@ -1,252 +1,258 @@
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
- sysVisible:!loopField.sysHidden
72
- }
73
- //页面状态控制
74
- if(loopField.editStates){
75
- tempField['editStates'] = loopField.editStates.split(',')
76
- }
77
- //单据状态控制
78
- if(loopField.editStatuss){
79
- tempField['editStatuss'] = loopField.editStatuss.split(',')
80
- }
81
- let extraInfo = loopField.extraInfo
82
- ? JSON.parse(loopField.extraInfo)
83
- : {}
84
- let userExtraInfo = loopField.userExtraInfo
85
- ? JSON.parse(loopField.userExtraInfo)
86
- : {}
87
- extraInfo = {...extraInfo, ...userExtraInfo}
88
- //存在额外参数,就赋值
89
- if (Object.keys(extraInfo).length) {
90
- tempField = XEUtils.assign(extraInfo, tempField)
91
- }
92
- if (tempField.controlType === controlType.select) {
93
- tempField['dataSource'] = XEUtils.filter(
94
- data.info.dictItems,
95
- p => p.dictCode === extraInfo.dataSource
96
- )
97
- }
98
-
99
- if(tempField.controlType === controlType.pager_button){
100
- tempPagerButtons.push(tempField)
101
- }else if(tempField.controlType===controlType.operation){
102
- //操作按钮列
103
- operationFields.push(tempField)
104
-
105
- }
106
- else{
107
- tempFields.push(tempField)
108
- }
109
- })
110
-
111
- tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
112
- if(operationFields.length>0){
113
- //添加右侧按钮操作列
114
- tempFields.push({
115
- field: controlType.operation,
116
- title: '操作',
117
- width: operationFields[0].width || 100,
118
- fixed: 'right',
119
- showOverflow: true,
120
- controlType: controlType.operation,
121
- params:{
122
- columns:operationFields
123
- }
124
- })
125
- }
126
- tempDataInfo[loopData.code]['fields'] = tempFields
127
-
128
- })
129
- data.info['dataInfo'] = tempDataInfo
130
- state.moduleViewInfo[data.moduleCode] = data.info
131
- },
132
- SET_NEW_ID: (state, id) => {
133
- state.newId = id
134
- },
135
- SET_UMS_URL:(state,url) => {
136
- state.umsUrl = url
137
- },
138
- SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
139
- state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
140
- },
141
- SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
142
- state.custPricePrecision = custPricePrecision
143
- },
144
- SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
145
- state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
146
- },
147
- SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
148
- state.supplyPricePrecision = supplyPricePrecision
149
- },
150
- SET_MSG_URL:(state,url) => {
151
- state.msgUrl = url
152
- },
153
- SET_IDENTITY_URL:(state,url) => {
154
- state.identityUrl = url
155
- },
156
- },
157
- actions: {
158
- /**
159
- * 系统登出
160
- * @param {} param0
161
- */
162
- logOut({commit}){
163
- // alert('会话过期3');
164
- if(window.$wujie){
165
- // alert('会话过期4');
166
- //通知主应用会员过期重新登陆
167
- window.$wujie.bus.$emit(
168
- 'subAppLoginOut',window.$wujie.props.webAppCode
169
- )
170
- }
171
- },
172
- setTabTitle({ commit }, tabInfo) {
173
- if (tabInfo.replaceQuery) {
174
- let newRoutePath =
175
- tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
176
- history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
177
- }
178
- //通知父应用修改Tab标签文字描述
179
- if(window.$wujie){
180
- window.$wujie.bus.$emit('subAppSetTabTitle', {
181
- title: tabInfo.title,
182
- name: tabInfo.name,
183
- query: tabInfo.query,
184
- replaceQuery: tabInfo.replaceQuery,
185
- path: tabInfo.path
186
- })
187
- }
188
- },
189
- closeTab({ commit }, fullPath) {
190
- if(window.$wujie){
191
- window.$wujie.bus.$emit(
192
- 'subAppCloseTab',
193
- window.$wujie.props.webAppActiveRule + fullPath
194
- )
195
- }
196
- },
197
- moduleLoadViewInfo({ commit, state }, dataInfo) {
198
- let vm = this
199
- return new Promise((resolve, reject) => {
200
- loadViewInfo(dataInfo.moduleCode)
201
- .then(reponseData => {
202
- commit('SET_MODULE_VIEW_INFO', {
203
- moduleCode: dataInfo.moduleCode,
204
- info: reponseData.content
205
- })
206
- resolve()
207
- })
208
- .catch(error => {
209
- reject(error)
210
- })
211
- })
212
- },
213
- // 固定返回工作台,并根据条件决定是否关闭其余标签
214
- goWorkbench({ commit }, tabsAllClose) {
215
- if(window.$wujie){
216
- window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
217
- }
218
- },
219
- // 替换页面
220
- replaceTab({ commit }, fullPath) {
221
- if(window.$wujie){
222
- window.$wujie.bus.$emit(
223
- 'subAppReplaceTab',
224
- window.$wujie.props.webAppActiveRule + fullPath
225
- )
226
- }
227
- },
228
- },
229
- modules:{},
230
- getters: {
231
- custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
232
- custPricePrecision:state=>state.custPricePrecision,
233
- supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
234
- supplyPricePrecision:state=>state.supplyPricePrecision,
235
- industryVersion:state=>state.industryVersion,
236
- isGenerateMatCode:state=>state.isGenerateMatCode,
237
- umsUrl:state=>state.umsUrl,
238
- msgUrl:state=>state.msgUrl,
239
- identityUrl:state=>state.identityUrl,
240
- token: state => state.token,
241
- webAppCode: state => state.webAppCode,
242
- moduleViewInfo: state => state.moduleViewInfo,
243
- controlSize: state => state.controlSize,
244
- newId: state => () => {
245
- state.newId = state.newId + 1
246
- return state.newId
247
- },
248
- userId: state => state.userId,
249
- userName: state => state.userName,
250
- staffId: state => state.staffId,
251
- }
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
+ wmsUrl:'',
15
+ identityUrl:'',
16
+ token: '',
17
+ industryVersion:'',//行业版本
18
+ custPriceNotTaxPrecision:0,
19
+ custPricePrecision:0,
20
+ supplyPriceNotTaxPrecision:0,
21
+ supplyPricePrecision:0,
22
+ isGenerateMatCode:'false',//是否生成物料编码
23
+ webAppCode: '',
24
+ moduleViewInfo: {},
25
+ controlSize: 'small',
26
+ newId: 0,//明细新增id
27
+ userId: '',
28
+ userName: '',
29
+ staffId: '',
30
+ },
31
+ mutations: {
32
+ SET_TOKEN: (state, token) => {
33
+ state.token = token
34
+ },
35
+ SET_USERID: (state, userId) => {
36
+ state.userId = userId
37
+ },
38
+ SET_USERNAME: (state, userName) => {
39
+ state.userName = userName
40
+ },
41
+ SET_STAFFID: (state, staffId) => {
42
+ state.staffId = staffId
43
+ },
44
+ SET_INDUSTRY_VERSION:(state,industryVersion)=>{
45
+ state.industryVersion = industryVersion
46
+ },
47
+ SET_IS_GENERATE_MAT_CODE:(state,isGenerateMatCode)=>{
48
+ state.isGenerateMatCode = isGenerateMatCode
49
+ },
50
+ SET_WEB_APP_CODE: (state, webAppCode) => {
51
+ state.webAppCode = webAppCode
52
+ },
53
+ SET_MODULE_VIEW_INFO: (state, data) => {
54
+ let tempDataInfo = {}
55
+ XEUtils.arrayEach(data.info.datas,loopData=>{
56
+ let tempFields = []
57
+ let tempPagerButtons = []
58
+ tempDataInfo[loopData.code] = {code:'',name:'',fields:[]}
59
+ tempDataInfo[loopData.code].code = loopData.code
60
+ tempDataInfo[loopData.code].name = loopData.name
61
+ let operationFields = []
62
+ XEUtils.arrayEach(loopData.fields,loopField=>{
63
+ let tempField = {
64
+ field: loopField.boundField,
65
+ title: loopField.name,
66
+ width: loopField.width,
67
+ visible: !loopField.hidden,
68
+ filters: loopField.isFilter,
69
+ sortable: loopField.isSortable,
70
+ controlType: loopField.controlType,
71
+ edit:loopField.edit
72
+ }
73
+ //页面状态控制
74
+ if(loopField.editStates){
75
+ tempField['editStates'] = loopField.editStates.split(',')
76
+ }
77
+ //单据状态控制
78
+ if(loopField.editStatuss){
79
+ tempField['editStatuss'] = loopField.editStatuss.split(',')
80
+ }
81
+ let extraInfo = loopField.extraInfo
82
+ ? JSON.parse(loopField.extraInfo)
83
+ : {}
84
+ let userExtraInfo = loopField.userExtraInfo
85
+ ? JSON.parse(loopField.userExtraInfo)
86
+ : {}
87
+ extraInfo = {...extraInfo, ...userExtraInfo}
88
+ //存在额外参数,就赋值
89
+ if (Object.keys(extraInfo).length) {
90
+ if (Object.hasOwn(extraInfo,'api')){
91
+ extraInfo['api'] = state[extraInfo['url']] + extraInfo['api']
92
+ }
93
+ tempField = XEUtils.assign(extraInfo, tempField)
94
+ }
95
+ if (tempField.controlType === controlType.select) {
96
+ tempField['dataSource'] = XEUtils.filter(
97
+ data.info.dictItems,
98
+ p => p.dictCode === extraInfo.dataSource
99
+ )
100
+ }
101
+
102
+ if(tempField.controlType === controlType.pager_button){
103
+ tempPagerButtons.push(tempField)
104
+ }else if(tempField.controlType===controlType.operation){
105
+ //操作按钮列
106
+ operationFields.push(tempField)
107
+
108
+ }
109
+ else{
110
+ tempFields.push(tempField)
111
+ }
112
+ })
113
+
114
+ tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
115
+ if(operationFields.length>0){
116
+ //添加右侧按钮操作列
117
+ tempFields.push({
118
+ field: controlType.operation,
119
+ title: '操作',
120
+ width: operationFields[0].width || 100,
121
+ fixed: 'right',
122
+ showOverflow: true,
123
+ controlType: controlType.operation,
124
+ params:{
125
+ columns:operationFields
126
+ }
127
+ })
128
+ }
129
+ tempDataInfo[loopData.code]['fields'] = tempFields
130
+
131
+ })
132
+ data.info['dataInfo'] = tempDataInfo
133
+ state.moduleViewInfo[data.moduleCode] = data.info
134
+ },
135
+ SET_NEW_ID: (state, id) => {
136
+ state.newId = id
137
+ },
138
+ SET_UMS_URL:(state,url) => {
139
+ state.umsUrl = url
140
+ },
141
+ SET_WMS_URL:(state,url) => {
142
+ state.wmsUrl = url
143
+ },
144
+ SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
145
+ state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
146
+ },
147
+ SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
148
+ state.custPricePrecision = custPricePrecision
149
+ },
150
+ SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
151
+ state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
152
+ },
153
+ SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
154
+ state.supplyPricePrecision = supplyPricePrecision
155
+ },
156
+ SET_MSG_URL:(state,url) => {
157
+ state.msgUrl = url
158
+ },
159
+ SET_IDENTITY_URL:(state,url) => {
160
+ state.identityUrl = url
161
+ },
162
+ },
163
+ actions: {
164
+ /**
165
+ * 系统登出
166
+ * @param {} param0
167
+ */
168
+ logOut({commit}){
169
+ // alert('会话过期3');
170
+ if(window.$wujie){
171
+ // alert('会话过期4');
172
+ //通知主应用会员过期重新登陆
173
+ window.$wujie.bus.$emit(
174
+ 'subAppLoginOut',window.$wujie.props.webAppCode
175
+ )
176
+ }
177
+ },
178
+ setTabTitle({ commit }, tabInfo) {
179
+ if (tabInfo.replaceQuery) {
180
+ let newRoutePath =
181
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
182
+ history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
183
+ }
184
+ //通知父应用修改Tab标签文字描述
185
+ if(window.$wujie){
186
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
187
+ title: tabInfo.title,
188
+ name: tabInfo.name,
189
+ query: tabInfo.query,
190
+ replaceQuery: tabInfo.replaceQuery,
191
+ path: tabInfo.path
192
+ })
193
+ }
194
+ },
195
+ closeTab({ commit }, fullPath) {
196
+ if(window.$wujie){
197
+ window.$wujie.bus.$emit(
198
+ 'subAppCloseTab',
199
+ window.$wujie.props.webAppActiveRule + fullPath
200
+ )
201
+ }
202
+ },
203
+ moduleLoadViewInfo({ commit, state }, dataInfo) {
204
+ let vm = this
205
+ return new Promise((resolve, reject) => {
206
+ loadViewInfo(dataInfo.moduleCode)
207
+ .then(reponseData => {
208
+ commit('SET_MODULE_VIEW_INFO', {
209
+ moduleCode: dataInfo.moduleCode,
210
+ info: reponseData.content
211
+ })
212
+ resolve()
213
+ })
214
+ .catch(error => {
215
+ reject(error)
216
+ })
217
+ })
218
+ },
219
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
220
+ goWorkbench({ commit }, tabsAllClose) {
221
+ if(window.$wujie){
222
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
223
+ }
224
+ },
225
+ // 替换页面
226
+ replaceTab({ commit }, fullPath) {
227
+ if(window.$wujie){
228
+ window.$wujie.bus.$emit(
229
+ 'subAppReplaceTab',
230
+ window.$wujie.props.webAppActiveRule + fullPath
231
+ )
232
+ }
233
+ },
234
+ },
235
+ modules:{},
236
+ getters: {
237
+ custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
238
+ custPricePrecision:state=>state.custPricePrecision,
239
+ supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
240
+ supplyPricePrecision:state=>state.supplyPricePrecision,
241
+ industryVersion:state=>state.industryVersion,
242
+ isGenerateMatCode:state=>state.isGenerateMatCode,
243
+ umsUrl:state=>state.umsUrl,
244
+ msgUrl:state=>state.msgUrl,
245
+ identityUrl:state=>state.identityUrl,
246
+ token: state => state.token,
247
+ webAppCode: state => state.webAppCode,
248
+ moduleViewInfo: state => state.moduleViewInfo,
249
+ controlSize: state => state.controlSize,
250
+ newId: state => () => {
251
+ state.newId = state.newId + 1
252
+ return state.newId
253
+ },
254
+ userId: state => state.userId,
255
+ userName: state => state.userName,
256
+ staffId: state => state.staffId,
257
+ }
252
258
  })
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