doway-coms 1.4.99 → 1.5.0

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 +2687 -2684
  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 +859 -859
  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 +250 -250
  74. package/vue.config.js +59 -59
@@ -1,251 +1,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
- 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
- let userExtraInfo = loopField.userExtraInfo
84
- ? JSON.parse(loopField.userExtraInfo)
85
- : {}
86
- extraInfo = {...extraInfo, ...userExtraInfo}
87
- //存在额外参数,就赋值
88
- if (Object.keys(extraInfo).length) {
89
- tempField = XEUtils.assign(extraInfo, tempField)
90
- }
91
- if (tempField.controlType === controlType.select) {
92
- tempField['dataSource'] = XEUtils.filter(
93
- data.info.dictItems,
94
- p => p.dictCode === extraInfo.dataSource
95
- )
96
- }
97
-
98
- if(tempField.controlType === controlType.pager_button){
99
- tempPagerButtons.push(tempField)
100
- }else if(tempField.controlType===controlType.operation){
101
- //操作按钮列
102
- operationFields.push(tempField)
103
-
104
- }
105
- else{
106
- tempFields.push(tempField)
107
- }
108
- })
109
-
110
- tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
111
- if(operationFields.length>0){
112
- //添加右侧按钮操作列
113
- tempFields.push({
114
- field: controlType.operation,
115
- title: '操作',
116
- width: operationFields[0].width || 100,
117
- fixed: 'right',
118
- showOverflow: true,
119
- controlType: controlType.operation,
120
- params:{
121
- columns:operationFields
122
- }
123
- })
124
- }
125
- tempDataInfo[loopData.code]['fields'] = tempFields
126
-
127
- })
128
- data.info['dataInfo'] = tempDataInfo
129
- state.moduleViewInfo[data.moduleCode] = data.info
130
- },
131
- SET_NEW_ID: (state, id) => {
132
- state.newId = id
133
- },
134
- SET_UMS_URL:(state,url) => {
135
- state.umsUrl = url
136
- },
137
- SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
138
- state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
139
- },
140
- SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
141
- state.custPricePrecision = custPricePrecision
142
- },
143
- SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
144
- state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
145
- },
146
- SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
147
- state.supplyPricePrecision = supplyPricePrecision
148
- },
149
- SET_MSG_URL:(state,url) => {
150
- state.msgUrl = url
151
- },
152
- SET_IDENTITY_URL:(state,url) => {
153
- state.identityUrl = url
154
- },
155
- },
156
- actions: {
157
- /**
158
- * 系统登出
159
- * @param {} param0
160
- */
161
- logOut({commit}){
162
- // alert('会话过期3');
163
- if(window.$wujie){
164
- // alert('会话过期4');
165
- //通知主应用会员过期重新登陆
166
- window.$wujie.bus.$emit(
167
- 'subAppLoginOut',window.$wujie.props.webAppCode
168
- )
169
- }
170
- },
171
- setTabTitle({ commit }, tabInfo) {
172
- if (tabInfo.replaceQuery) {
173
- let newRoutePath =
174
- tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
175
- history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
176
- }
177
- //通知父应用修改Tab标签文字描述
178
- if(window.$wujie){
179
- window.$wujie.bus.$emit('subAppSetTabTitle', {
180
- title: tabInfo.title,
181
- name: tabInfo.name,
182
- query: tabInfo.query,
183
- replaceQuery: tabInfo.replaceQuery,
184
- path: tabInfo.path
185
- })
186
- }
187
- },
188
- closeTab({ commit }, fullPath) {
189
- if(window.$wujie){
190
- window.$wujie.bus.$emit(
191
- 'subAppCloseTab',
192
- window.$wujie.props.webAppActiveRule + fullPath
193
- )
194
- }
195
- },
196
- moduleLoadViewInfo({ commit, state }, dataInfo) {
197
- let vm = this
198
- return new Promise((resolve, reject) => {
199
- loadViewInfo(dataInfo.moduleCode)
200
- .then(reponseData => {
201
- commit('SET_MODULE_VIEW_INFO', {
202
- moduleCode: dataInfo.moduleCode,
203
- info: reponseData.content
204
- })
205
- resolve()
206
- })
207
- .catch(error => {
208
- reject(error)
209
- })
210
- })
211
- },
212
- // 固定返回工作台,并根据条件决定是否关闭其余标签
213
- goWorkbench({ commit }, tabsAllClose) {
214
- if(window.$wujie){
215
- window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
216
- }
217
- },
218
- // 替换页面
219
- replaceTab({ commit }, fullPath) {
220
- if(window.$wujie){
221
- window.$wujie.bus.$emit(
222
- 'subAppReplaceTab',
223
- window.$wujie.props.webAppActiveRule + fullPath
224
- )
225
- }
226
- },
227
- },
228
- modules:{},
229
- getters: {
230
- custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
231
- custPricePrecision:state=>state.custPricePrecision,
232
- supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
233
- supplyPricePrecision:state=>state.supplyPricePrecision,
234
- industryVersion:state=>state.industryVersion,
235
- isGenerateMatCode:state=>state.isGenerateMatCode,
236
- umsUrl:state=>state.umsUrl,
237
- msgUrl:state=>state.msgUrl,
238
- identityUrl:state=>state.identityUrl,
239
- token: state => state.token,
240
- webAppCode: state => state.webAppCode,
241
- moduleViewInfo: state => state.moduleViewInfo,
242
- controlSize: state => state.controlSize,
243
- newId: state => () => {
244
- state.newId = state.newId + 1
245
- return state.newId
246
- },
247
- userId: state => state.userId,
248
- userName: state => state.userName,
249
- staffId: state => state.staffId,
250
- }
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
+ let userExtraInfo = loopField.userExtraInfo
84
+ ? JSON.parse(loopField.userExtraInfo)
85
+ : {}
86
+ extraInfo = {...extraInfo, ...userExtraInfo}
87
+ //存在额外参数,就赋值
88
+ if (Object.keys(extraInfo).length) {
89
+ tempField = XEUtils.assign(extraInfo, tempField)
90
+ }
91
+ if (tempField.controlType === controlType.select) {
92
+ tempField['dataSource'] = XEUtils.filter(
93
+ data.info.dictItems,
94
+ p => p.dictCode === extraInfo.dataSource
95
+ )
96
+ }
97
+
98
+ if(tempField.controlType === controlType.pager_button){
99
+ tempPagerButtons.push(tempField)
100
+ }else if(tempField.controlType===controlType.operation){
101
+ //操作按钮列
102
+ operationFields.push(tempField)
103
+
104
+ }
105
+ else{
106
+ tempFields.push(tempField)
107
+ }
108
+ })
109
+
110
+ tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
111
+ if(operationFields.length>0){
112
+ //添加右侧按钮操作列
113
+ tempFields.push({
114
+ field: controlType.operation,
115
+ title: '操作',
116
+ width: operationFields[0].width || 100,
117
+ fixed: 'right',
118
+ showOverflow: true,
119
+ controlType: controlType.operation,
120
+ params:{
121
+ columns:operationFields
122
+ }
123
+ })
124
+ }
125
+ tempDataInfo[loopData.code]['fields'] = tempFields
126
+
127
+ })
128
+ data.info['dataInfo'] = tempDataInfo
129
+ state.moduleViewInfo[data.moduleCode] = data.info
130
+ },
131
+ SET_NEW_ID: (state, id) => {
132
+ state.newId = id
133
+ },
134
+ SET_UMS_URL:(state,url) => {
135
+ state.umsUrl = url
136
+ },
137
+ SET_CUST_PRICE_NOT_TAX_PRECISION:(state,custPriceNotTaxPrecision)=>{
138
+ state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
139
+ },
140
+ SET_CUST_PRICE_PRECISION:(state,custPricePrecision)=>{
141
+ state.custPricePrecision = custPricePrecision
142
+ },
143
+ SET_SUPPLY_PRICE_NOT_TAX_PRECISION:(state,supplyPriceNotTaxPrecision)=>{
144
+ state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
145
+ },
146
+ SET_SUPPLY_PRICE_PRECISION:(state,supplyPricePrecision)=>{
147
+ state.supplyPricePrecision = supplyPricePrecision
148
+ },
149
+ SET_MSG_URL:(state,url) => {
150
+ state.msgUrl = url
151
+ },
152
+ SET_IDENTITY_URL:(state,url) => {
153
+ state.identityUrl = url
154
+ },
155
+ },
156
+ actions: {
157
+ /**
158
+ * 系统登出
159
+ * @param {} param0
160
+ */
161
+ logOut({commit}){
162
+ // alert('会话过期3');
163
+ if(window.$wujie){
164
+ // alert('会话过期4');
165
+ //通知主应用会员过期重新登陆
166
+ window.$wujie.bus.$emit(
167
+ 'subAppLoginOut',window.$wujie.props.webAppCode
168
+ )
169
+ }
170
+ },
171
+ setTabTitle({ commit }, tabInfo) {
172
+ if (tabInfo.replaceQuery) {
173
+ let newRoutePath =
174
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
175
+ history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
176
+ }
177
+ //通知父应用修改Tab标签文字描述
178
+ if(window.$wujie){
179
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
180
+ title: tabInfo.title,
181
+ name: tabInfo.name,
182
+ query: tabInfo.query,
183
+ replaceQuery: tabInfo.replaceQuery,
184
+ path: tabInfo.path
185
+ })
186
+ }
187
+ },
188
+ closeTab({ commit }, fullPath) {
189
+ if(window.$wujie){
190
+ window.$wujie.bus.$emit(
191
+ 'subAppCloseTab',
192
+ window.$wujie.props.webAppActiveRule + fullPath
193
+ )
194
+ }
195
+ },
196
+ moduleLoadViewInfo({ commit, state }, dataInfo) {
197
+ let vm = this
198
+ return new Promise((resolve, reject) => {
199
+ loadViewInfo(dataInfo.moduleCode)
200
+ .then(reponseData => {
201
+ commit('SET_MODULE_VIEW_INFO', {
202
+ moduleCode: dataInfo.moduleCode,
203
+ info: reponseData.content
204
+ })
205
+ resolve()
206
+ })
207
+ .catch(error => {
208
+ reject(error)
209
+ })
210
+ })
211
+ },
212
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
213
+ goWorkbench({ commit }, tabsAllClose) {
214
+ if(window.$wujie){
215
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
216
+ }
217
+ },
218
+ // 替换页面
219
+ replaceTab({ commit }, fullPath) {
220
+ if(window.$wujie){
221
+ window.$wujie.bus.$emit(
222
+ 'subAppReplaceTab',
223
+ window.$wujie.props.webAppActiveRule + fullPath
224
+ )
225
+ }
226
+ },
227
+ },
228
+ modules:{},
229
+ getters: {
230
+ custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
231
+ custPricePrecision:state=>state.custPricePrecision,
232
+ supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
233
+ supplyPricePrecision:state=>state.supplyPricePrecision,
234
+ industryVersion:state=>state.industryVersion,
235
+ isGenerateMatCode:state=>state.isGenerateMatCode,
236
+ umsUrl:state=>state.umsUrl,
237
+ msgUrl:state=>state.msgUrl,
238
+ identityUrl:state=>state.identityUrl,
239
+ token: state => state.token,
240
+ webAppCode: state => state.webAppCode,
241
+ moduleViewInfo: state => state.moduleViewInfo,
242
+ controlSize: state => state.controlSize,
243
+ newId: state => () => {
244
+ state.newId = state.newId + 1
245
+ return state.newId
246
+ },
247
+ userId: state => state.userId,
248
+ userName: state => state.userName,
249
+ staffId: state => state.staffId,
250
+ }
251
251
  })
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