mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-07 02:19:49 +08:00
refine
This commit is contained in:
parent
02097c0ce5
commit
383b2132c5
@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function userSearch(name) {
|
export function searchUser(name) {
|
||||||
return request({
|
return request({
|
||||||
url: '/search/user',
|
url: '/search/user',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -88,29 +88,29 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.back-to-ceiling {
|
.back-to-ceiling {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-to-ceiling:hover {
|
.back-to-ceiling:hover {
|
||||||
background: #d5dbe7;
|
background: #d5dbe7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-enter-active,
|
.fade-enter-active,
|
||||||
.fade-leave-active {
|
.fade-leave-active {
|
||||||
transition: opacity .5s;
|
transition: opacity .5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-enter,
|
.fade-enter,
|
||||||
.fade-leave-to {
|
.fade-leave-to {
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-to-ceiling .Icon {
|
.back-to-ceiling .Icon {
|
||||||
fill: #9aaabf;
|
fill: #9aaabf;
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -59,14 +59,15 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-breadcrumb.el-breadcrumb {
|
.app-breadcrumb.el-breadcrumb {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
.no-redirect {
|
|
||||||
color: #97a8be;
|
.no-redirect {
|
||||||
cursor: text;
|
color: #97a8be;
|
||||||
}
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -17,6 +17,9 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.destroy()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
click() {
|
click() {
|
||||||
if (!screenfull.enabled) {
|
if (!screenfull.enabled) {
|
||||||
@ -28,11 +31,17 @@ export default {
|
|||||||
}
|
}
|
||||||
screenfull.toggle()
|
screenfull.toggle()
|
||||||
},
|
},
|
||||||
|
change() {
|
||||||
|
this.isFullscreen = screenfull.isFullscreen
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
if (screenfull.enabled) {
|
if (screenfull.enabled) {
|
||||||
screenfull.on('change', () => {
|
screenfull.on('change', this.change)
|
||||||
this.isFullscreen = screenfull.isFullscreen
|
}
|
||||||
})
|
},
|
||||||
|
destroy() {
|
||||||
|
if (screenfull.enabled) {
|
||||||
|
screenfull.off('change', this.change)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,9 @@ export default {
|
|||||||
beforeMount() {
|
beforeMount() {
|
||||||
window.addEventListener('resize', this.resizeHandler)
|
window.addEventListener('resize', this.resizeHandler)
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.resizeHandler)
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const isMobile = this.isMobile()
|
const isMobile = this.isMobile()
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
@ -81,7 +81,7 @@ import MDinput from '@/components/MDinput'
|
|||||||
import Sticky from '@/components/Sticky' // 粘性header组件
|
import Sticky from '@/components/Sticky' // 粘性header组件
|
||||||
import { validURL } from '@/utils/validate'
|
import { validURL } from '@/utils/validate'
|
||||||
import { fetchArticle } from '@/api/article'
|
import { fetchArticle } from '@/api/article'
|
||||||
import { userSearch } from '@/api/remoteSearch'
|
import { searchUser } from '@/api/remoteSearch'
|
||||||
import Warning from './Warning'
|
import Warning from './Warning'
|
||||||
import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
|
import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ export default {
|
|||||||
this.postForm.status = 'draft'
|
this.postForm.status = 'draft'
|
||||||
},
|
},
|
||||||
getRemoteUserList(query) {
|
getRemoteUserList(query) {
|
||||||
userSearch(query).then(response => {
|
searchUser(query).then(response => {
|
||||||
if (!response.data.items) return
|
if (!response.data.items) return
|
||||||
this.userListOptions = response.data.items.map(v => v.name)
|
this.userListOptions = response.data.items.map(v => v.name)
|
||||||
})
|
})
|
||||||
|
@ -31,8 +31,8 @@ module.exports = {
|
|||||||
errors: true
|
errors: true
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
// Detail: https://cli.vuejs.org/config/#devserver-proxy
|
// change xxx-api/login => mock/login
|
||||||
// xxx-api/login => mock/login
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: `http://localhost:${port}/mock`,
|
target: `http://localhost:${port}/mock`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
@ -71,6 +71,8 @@ module.exports = {
|
|||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
config.plugins.delete('preload') // TODO: need test
|
config.plugins.delete('preload') // TODO: need test
|
||||||
config.plugins.delete('prefetch') // TODO: need test
|
config.plugins.delete('prefetch') // TODO: need test
|
||||||
|
|
||||||
|
// set svg-sprite-loader
|
||||||
config.module
|
config.module
|
||||||
.rule('svg')
|
.rule('svg')
|
||||||
.exclude.add(resolve('src/icons'))
|
.exclude.add(resolve('src/icons'))
|
||||||
@ -86,6 +88,8 @@ module.exports = {
|
|||||||
symbolId: 'icon-[name]'
|
symbolId: 'icon-[name]'
|
||||||
})
|
})
|
||||||
.end()
|
.end()
|
||||||
|
|
||||||
|
// set preserveWhitespace
|
||||||
config.module
|
config.module
|
||||||
.rule('vue')
|
.rule('vue')
|
||||||
.use('vue-loader')
|
.use('vue-loader')
|
||||||
@ -120,17 +124,17 @@ module.exports = {
|
|||||||
name: 'chunk-libs',
|
name: 'chunk-libs',
|
||||||
test: /[\\/]node_modules[\\/]/,
|
test: /[\\/]node_modules[\\/]/,
|
||||||
priority: 10,
|
priority: 10,
|
||||||
chunks: 'initial' // 只打包初始时依赖的第三方
|
chunks: 'initial' // only package third parties that are initially dependent
|
||||||
},
|
},
|
||||||
elementUI: {
|
elementUI: {
|
||||||
name: 'chunk-elementUI', // 单独将 elementUI 拆包
|
name: 'chunk-elementUI', // split elementUI into a single package
|
||||||
priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
|
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||||
test: /[\\/]node_modules[\\/]element-ui[\\/]/
|
test: /[\\/]node_modules[\\/]element-ui[\\/]/
|
||||||
},
|
},
|
||||||
commons: {
|
commons: {
|
||||||
name: 'chunk-commons',
|
name: 'chunk-commons',
|
||||||
test: resolve('src/components'), // 可自定义拓展你的规则
|
test: resolve('src/components'), // can customize your rules
|
||||||
minChunks: 3, // 最小公用次数
|
minChunks: 3, // minimum common number
|
||||||
priority: 5,
|
priority: 5,
|
||||||
reuseExistingChunk: true
|
reuseExistingChunk: true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user