doway-coms 1.5.7 → 1.5.9

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/dist/css/chunk-vendors.7f83d8f9.css +8 -0
  4. package/dist/css/index.7946d50b.css +1 -0
  5. package/dist/favicon.ico +0 -0
  6. package/dist/js/chunk-vendors.28fda91d.js +340 -0
  7. package/dist/js/index.49bc6add.js +2 -0
  8. package/lib/doway-coms.common.js +120397 -0
  9. package/lib/doway-coms.css +1 -0
  10. package/lib/doway-coms.umd.js +120407 -0
  11. package/lib/doway-coms.umd.min.js +328 -0
  12. package/package.json +52 -52
  13. package/packages/BaseButton/index.js +7 -7
  14. package/packages/BaseButton/src/index.vue +241 -241
  15. package/packages/BaseCheckbox/index.js +7 -7
  16. package/packages/BaseCheckbox/src/index.vue +134 -134
  17. package/packages/BaseDate/index.js +7 -7
  18. package/packages/BaseDate/src/index.vue +197 -197
  19. package/packages/BaseDateWeek/index.js +7 -7
  20. package/packages/BaseDateWeek/src/index.vue +163 -163
  21. package/packages/BaseDatetime/index.js +7 -7
  22. package/packages/BaseDatetime/src/index.vue +196 -196
  23. package/packages/BaseForm/index.js +7 -7
  24. package/packages/BaseForm/src/index.vue +664 -664
  25. package/packages/BaseGantt/index.js +9 -9
  26. package/packages/BaseGantt/src/index.vue +604 -604
  27. package/packages/BaseGrid/index.js +9 -9
  28. package/packages/BaseGrid/src/index.vue +2700 -2690
  29. package/packages/BaseGridAdjust/index.js +9 -9
  30. package/packages/BaseGridAdjust/src/index.vue +455 -455
  31. package/packages/BaseInput/index.js +7 -7
  32. package/packages/BaseInput/src/index.vue +164 -164
  33. package/packages/BaseIntervalInput/index.js +7 -7
  34. package/packages/BaseIntervalInput/src/index.vue +310 -310
  35. package/packages/BaseKanbanEmpty/index.js +7 -7
  36. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  37. package/packages/BaseNumberInput/index.js +7 -7
  38. package/packages/BaseNumberInput/src/index.vue +229 -229
  39. package/packages/BasePagination/index.js +7 -7
  40. package/packages/BasePagination/src/index.vue +91 -91
  41. package/packages/BasePictureCard/index.js +7 -7
  42. package/packages/BasePictureCard/src/index.vue +561 -561
  43. package/packages/BasePrintPreview/index.js +7 -7
  44. package/packages/BasePrintPreview/src/index.vue +117 -117
  45. package/packages/BasePulldown/index.js +7 -7
  46. package/packages/BasePulldown/src/index.vue +867 -867
  47. package/packages/BaseSearch/index.js +7 -7
  48. package/packages/BaseSearch/src/index.vue +935 -935
  49. package/packages/BaseSelect/index.js +7 -7
  50. package/packages/BaseSelect/src/index.vue +153 -153
  51. package/packages/BaseSelectMulti/index.js +7 -7
  52. package/packages/BaseSelectMulti/src/index.vue +148 -148
  53. package/packages/BaseTextArea/index.js +7 -7
  54. package/packages/BaseTextArea/src/index.vue +178 -178
  55. package/packages/BaseTime/index.js +7 -7
  56. package/packages/BaseTime/src/index.vue +166 -166
  57. package/packages/BaseTool/index.js +7 -7
  58. package/packages/BaseTool/src/index.vue +349 -349
  59. package/packages/BaseToolStatus/index.js +7 -7
  60. package/packages/BaseToolStatus/src/index.vue +383 -383
  61. package/packages/index.js +165 -165
  62. package/packages/styles/default.less +80 -80
  63. package/packages/utils/api.js +45 -45
  64. package/packages/utils/auth.js +38 -38
  65. package/packages/utils/common.js +583 -583
  66. package/packages/utils/dom.js +181 -181
  67. package/packages/utils/enum.js +83 -83
  68. package/packages/utils/filters.js +458 -458
  69. package/packages/utils/gridFormat.js +52 -52
  70. package/packages/utils/msg.js +16 -16
  71. package/packages/utils/patchFiles.js +44 -44
  72. package/packages/utils/request.js +169 -169
  73. package/packages/utils/store.js +254 -257
  74. package/vue.config.js +59 -59
@@ -1,258 +1,255 @@
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
- }
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
+ if(tempField.sysVisible===false){
74
+ tempField.visible = false
75
+ }
76
+ //页面状态控制
77
+ if(loopField.editStates){
78
+ tempField['editStates'] = loopField.editStates.split(',')
79
+ }
80
+ //单据状态控制
81
+ if(loopField.editStatuss){
82
+ tempField['editStatuss'] = loopField.editStatuss.split(',')
83
+ }
84
+ let extraInfo = loopField.extraInfo
85
+ ? JSON.parse(loopField.extraInfo)
86
+ : {}
87
+ let userExtraInfo = loopField.userExtraInfo
88
+ ? JSON.parse(loopField.userExtraInfo)
89
+ : {}
90
+ extraInfo = {...extraInfo, ...userExtraInfo}
91
+ //存在额外参数,就赋值
92
+ if (Object.keys(extraInfo).length) {
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_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
142
+ state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
143
+ },
144
+ SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
145
+ state.custPricePrecision = custPricePrecision
146
+ },
147
+ SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
148
+ state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
149
+ },
150
+ SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
151
+ state.supplyPricePrecision = supplyPricePrecision
152
+ },
153
+ SET_MSG_URL:(state,url) => {
154
+ state.msgUrl = url
155
+ },
156
+ SET_IDENTITY_URL:(state,url) => {
157
+ state.identityUrl = url
158
+ },
159
+ },
160
+ actions: {
161
+ /**
162
+ * 系统登出
163
+ * @param {} param0
164
+ */
165
+ logOut({commit}){
166
+ // alert('会话过期3');
167
+ if(window.$wujie){
168
+ // alert('会话过期4');
169
+ //通知主应用会员过期重新登陆
170
+ window.$wujie.bus.$emit(
171
+ 'subAppLoginOut',window.$wujie.props.webAppCode
172
+ )
173
+ }
174
+ },
175
+ setTabTitle({ commit }, tabInfo) {
176
+ if (tabInfo.replaceQuery) {
177
+ let newRoutePath =
178
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
179
+ history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
180
+ }
181
+ //通知父应用修改Tab标签文字描述
182
+ if(window.$wujie){
183
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
184
+ title: tabInfo.title,
185
+ name: tabInfo.name,
186
+ query: tabInfo.query,
187
+ replaceQuery: tabInfo.replaceQuery,
188
+ path: tabInfo.path
189
+ })
190
+ }
191
+ },
192
+ closeTab({ commit }, fullPath) {
193
+ if(window.$wujie){
194
+ window.$wujie.bus.$emit(
195
+ 'subAppCloseTab',
196
+ window.$wujie.props.webAppActiveRule + fullPath
197
+ )
198
+ }
199
+ },
200
+ moduleLoadViewInfo({ commit, state }, dataInfo) {
201
+ let vm = this
202
+ return new Promise((resolve, reject) => {
203
+ loadViewInfo(dataInfo.moduleCode)
204
+ .then(reponseData => {
205
+ commit('SET_MODULE_VIEW_INFO', {
206
+ moduleCode: dataInfo.moduleCode,
207
+ info: reponseData.content
208
+ })
209
+ resolve()
210
+ })
211
+ .catch(error => {
212
+ reject(error)
213
+ })
214
+ })
215
+ },
216
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
217
+ goWorkbench({ commit }, tabsAllClose) {
218
+ if(window.$wujie){
219
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
220
+ }
221
+ },
222
+ // 替换页面
223
+ replaceTab({ commit }, fullPath) {
224
+ if(window.$wujie){
225
+ window.$wujie.bus.$emit(
226
+ 'subAppReplaceTab',
227
+ window.$wujie.props.webAppActiveRule + fullPath
228
+ )
229
+ }
230
+ },
231
+ },
232
+ modules:{},
233
+ getters: {
234
+ custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
235
+ custPricePrecision:state=>state.custPricePrecision,
236
+ supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
237
+ supplyPricePrecision:state=>state.supplyPricePrecision,
238
+ industryVersion:state=>state.industryVersion,
239
+ isGenerateMatCode:state=>state.isGenerateMatCode,
240
+ umsUrl:state=>state.umsUrl,
241
+ msgUrl:state=>state.msgUrl,
242
+ identityUrl:state=>state.identityUrl,
243
+ token: state => state.token,
244
+ webAppCode: state => state.webAppCode,
245
+ moduleViewInfo: state => state.moduleViewInfo,
246
+ controlSize: state => state.controlSize,
247
+ newId: state => () => {
248
+ state.newId = state.newId + 1
249
+ return state.newId
250
+ },
251
+ userId: state => state.userId,
252
+ userName: state => state.userName,
253
+ staffId: state => state.staffId,
254
+ }
258
255
  })
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