Fork me on GitHub

laravel vue-element-admin 安装指南

参考教程

环境

php: ^7.4

laravel: 7.*

element: ^2.13.2

vue: ^2.6.10

操作

安装项目

更具体内容见 此教程

1
$ composer create-project laravel/laravel YourProjectName --prefer-dist "7.*"
安装 vue-element-admin
1
$ git clone https://github.com/PanJiaChen/vue-element-admin.git
合并 package.json

将 vue-element-admin 中 package.json 的 dependencies,devDependencies

合并到 laravel 的 package.json 中

以 vue-element-admin 为主

复制 babel.config.js 到 laravel 根目录
复制项目

将 vue-element-admin 中整个 src 目录下的文件复制到 laravel 项目中的 resources/vue-element-admin 目录中

npm 安装
1
2
$ npm install
$ npm run dev

部分问题

别名定义
1
Module not found: Error: Can't resolve '@/views/zip/index' in '/path/to/laravel-vue-admin/resources/backend/router'

在 webpack.mix.js 中增加项目 src 目录的别名

1
2
3
4
5
6
7
8
// webpack.mix.js
mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/vue-element-admin/src'),
},
},
})
babel 失败
1
Module build failed (from ./node_modules/babel-loader/lib/index.js):

复制 babel.config.js 到 laravel 根目录

字体加载失败
1
2
3
4
 error  in ./resources/vue-element/src/assets/font/DS-DIGIT.TTF

Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

安装 npm 的 file-loader,ttf-loader

并在 webpack.mix.js 中增加关于新的 module loader 的 webpack config

1
$ npm install file-loader ttf-loader -D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//webpack.mix.js
mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/vue-element/src'),
},
},

//加入新的 module 的加载规则
module: {
rules: [
{
test: /\.TTF$/,
use: [
{
loader: 'file-loader',
options: {
name: './font/[hash].[ext]',
},
},
]
}
]
}

})
图片不显示
1
src=[object module]

vue 默认使用的是 commonjs,webpack ^4.* 使用的是 es6 语法,两边任意一边凑过去都可以

可以在 webpack.mix.js 的 rules 中加入以下(但是没有解决我的问题)

1
2
3
4
5
6
7
{
test: /\.(png|jpe?g|gif|svg)$/,
loader: 'url-loader',
options: {
esModule: false
}
}

或可以降低 file-loader 的版本

1
$ npm install file-loader@3.*
最后的 webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// webpack.mix.js
const mix = require('laravel-mix');

/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/

mix.js('resources/vue-element/src/main.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');

mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/vue-element/src'),
},
},
module: {
rules: [
{
test: /\.TTF$/,
use: [
{
loader: 'file-loader',
options: {
name: './font/[hash].[ext]',
},
},
]
}
]
}

})

讲座笔记-洪奕光-复杂多智能体系统的分析与调控

一定要找具体的研究问题是什么!

观点

做科研一定要找具体的研究问题是什么,泛泛而谈难度太高

努力做交叉

国家的判断:新的突破点在学科交叉

人工智能很重要,不要拒绝机器学习

博弈论是天然的多智能体系统,现在没有特别热门是因为智能体还不够智能

社会网络跟博弈论的结合是趋势

复杂网络多智能体在社会学上的应用

提出了若干改进模型

应用:尝试解释巴黎协定各国间的动力学行为

问题:观测器难以建立,控制器设计必须足够温柔

Notebook - Prescribed-Time Stabilization of Controllable Planar Systems Using Switched State Feedback

10.16 Tao

Thesis Statement

double $u$, control to $0$

Main Contribution

Using switch state feedback to solve problems in

$u_1 + u_2$, double controller

From an arbitrarily small domain to $0$

Since $\mu= \frac{T_1}{T_1-t}$, switch before $t =T_1$ (otherwise $\mu$ is infinite), so add $t_s$ and $R$ (a level set)

New Knowledge

prescribed time

finite time

level set

$sign()$ function

Words and Phrases

ordinary differential equations 常微分方程

Questions

Good Sentences

The approach is based on $\cdots$.

$\cdots$, governed by $\cdots$, remains an active research area.

Laravel Vue 项目本地化部署

项目拷贝

1
git clone git@github.com:YourUserName/YourRepositories.git

本地化

1
2
3
4
5
6
7
composer install 
cp .env.example .env # Then modify .env file
php artisan key:generate
npm install
npm install vue-loader vue-template-compiler --save-dev
# modify webpack, add vue() to import chain
npm run dev
  • Copyrights © 2020-2023 Jack Kong
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信