基于Vue3.x后台管理系统设计解决方案
npm install ms-element --save-dev
如果出现这错误:Cannot read properties of null (reading 'isCE') 需要在vue.config.js chainWebpack 添加以下代码
config.resolve.symlinks(false)
config.resolve.alias.set('vue', path.resolve('./node_modules/vue'))
import {createApp} from 'vue'
import App from './App'
import 'ms-element/lib/style/theme/index.css'
import MsElement from 'ms-element'
createApp(App).use(MsElement)
import Vue from 'vue'
import App from './App'
import 'ms-element/lib/style/theme/frame-layout.css'
import { FrameLayout } from 'ms-element' // or import FrameLayout from 'ms-element/lib/frame-layout'
createApp(App).component(FrameLayout.name, FrameLayout)
npm install ms-designer --save-dev
// 引入devServer
const MSDevServer = require('ms-designer/devServer')
// 配置 devServer
devServer: {
proxy: {
'/designer/': {
target: 'http://mselement.bittyos.com/'
},
'/designer-api/': {
target: 'http://mselement.bittyos.com/',
changeOrigin: true
}
},
before (app) {
MSDevServer(app, path.join(__filename, '../'))
}
}