代码拉取完成,页面将自动刷新
const {VueLoaderPlugin} = require('vue-loader')
const path = require('path')
const glob = require('glob')
const sections = (() => {
const docs = glob
.sync('docs/*.md')
.map(p => ({name: path.basename(p, '.md'), content: p}))
const demos = []
let faq = '' // 约定至多只有一个faq.md
const guides = []
docs.forEach(d => {
if (/^faq$/i.test(d.name)) {
d.name = d.name.toUpperCase()
faq = d
} else if (/^guide-/.test(d.name)) {
guides.push(d)
} else {
demos.push(d)
}
})
return [
{
name: 'Components',
components: 'src/*.vue',
usageMode: 'expand'
},
{
name: 'Demo',
sections: demos,
sectionDepth: 2
},
...(faq ? [faq] : []),
...(guides.length ? [{name: 'Guide', sections: guides, sectionDepth: 2}] : [])
]
})()
module.exports = {
styleguideDir: 'docs',
pagePerSection: true,
ribbon: {
url: 'https://github.com/FengZeming/vue-el-upload'
},
require: [
'./styleguide/element.js'
],
sections,
webpackConfig: {
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /\.less$/,
loaders: ['vue-style-loader', 'css-loader', 'less-loader']
},
{
test: /\.(woff2?|eot|[ot]tf)(\?.*)?$/,
loader: 'file-loader'
}
]
},
plugins: [new VueLoaderPlugin()],
devServer: {
open: true,
overlay: {
warnings: false,
errors: true,
},
proxy: {
'/dev-api': {
// target: 'http://netcar.ysdcar.com/net_car/pc',
target: 'http://localhost:3000/',
pathRewrite: {
'^/dev-api': '',
},
secure: false,
changeOrigin: true,
},
},
},
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。