` 元素,也不支持 `v-else
+
diff --git a/vue/6-列表渲染.md b/vue/6-列表渲染.md
new file mode 100644
index 0000000..7a38baa
--- /dev/null
+++ b/vue/6-列表渲染.md
@@ -0,0 +1,221 @@
+#### v-for
+
+```html
+
+ -
+ {{ item.message }}
+
+
+```
+
+```js
+var example1 = new Vue({
+ el: '#example-1',
+ data: {
+ items: [
+ { message: 'Foo' },
+ { message: 'Bar' }
+ ]
+ }
+})
+```
+
+```html
+
+ -
+ {{ parentMessage }} - {{ index }} - {{ item.message }}
+
+
+```
+
+```js
+var example2 = new Vue({
+ el: '#example-2',
+ data: {
+ parentMessage: 'Parent',
+ items: [
+ { message: 'Foo' },
+ { message: 'Bar' }
+ ]
+ }
+})
+```
+
+### v-for遍历一个对象的元素
+
+```html
+
+
+
+ {{ name }}: {{ value }}
+
+
+
+ {{ index }}. {{ name }}: {{ value }}
+
+
+
+
+
+```
+
+```js
+new Vue({
+ el: '#v-for-object',
+ data: {
+ object: {
+ title: 'How to do lists in Vue',
+ author: 'Jane Doe',
+ publishedAt: '2016-04-10'
+ }
+ }
+})
+```
+
+#### 显示过滤/排序后的结果
+
+- 有时,我们想要显示一个数组经过过滤或排序后的版本,而不实际变更或重置原始数据。在这种情况下,可以创建一个计算属性,来返回过滤或排序后的数组。
+
+```html
+{{ n }}
+```
+
+```js
+data: {
+ numbers: [ 1, 2, 3, 4, 5 ]
+},
+computed: {
+ evenNumbers: function () {
+ return this.numbers.filter(function (number) {
+ return number % 2 === 0
+ })
+ }
+}
+```
+
+- 在计算属性不适用的情况下 (例如,在嵌套 `v-for` 循环中) 可以使用一个方法
+
+```html
+
+```
+
+```js
+data: {
+ sets: [[ 1, 2, 3, 4, 5 ], [6, 7, 8, 9, 10]]
+},
+methods: {
+ even: function (numbers) {
+ return numbers.filter(function (number) {
+ return number % 2 === 0
+ })
+ }
+}
+```
+
+```html
+
+ {{ n }}
+
+
+
+```
+
+#### v-for,v-if 一同使用
+
+- 当它们处于同一节点,`v-for` 的优先级比 `v-if` 更高,这意味着 `v-if` 将分别重复运行于每个 `v-for` 循环中。当你只想为*部分*项渲染节点时,这种优先级的机制会十分有用。
+-
+
+```html
+<--代码将只渲染未完成的 todo-->
+
+ {{ todo }}
+
+
+No todos left!
+```
+
+#### v-for在组件中
+
+```html
+
+```
+
+
+
+```js
+Vue.component('todo-item', {
+ template: '\
+ \
+ {{ title }}\
+ \
+ \
+ ',
+ props: ['title']
+})
+
+new Vue({
+ el: '#todo-list-example',
+ data: {
+ newTodoText: '',
+ todos: [
+ {
+ id: 1,
+ title: 'Do the dishes',
+ },
+ {
+ id: 2,
+ title: 'Take out the trash',
+ },
+ {
+ id: 3,
+ title: 'Mow the lawn'
+ }
+ ],
+ nextTodoId: 4
+ },
+ methods: {
+ addNewTodo: function () {
+ this.todos.push({
+ id: this.nextTodoId++,
+ title: this.newTodoText
+ })
+ this.newTodoText = ''
+ }
+ }
+})
+```
+
diff --git a/vue/7-事件处理.md b/vue/7-事件处理.md
new file mode 100644
index 0000000..99c79e2
--- /dev/null
+++ b/vue/7-事件处理.md
@@ -0,0 +1,125 @@
+```html
+
+
+
The button above has been clicked {{ counter }} times.
+
+
+
+
+
+```
+
+```js
+var example1 = new Vue({
+ el: '#example-1',
+ data: {
+ counter: 0
+ }
+})
+var example2 = new Vue({
+ el: '#example-2',
+ data: {
+ name: 'Vue.js'
+ },
+ // 在 `methods` 对象中定义方法
+ methods: {
+ greet: function (event) {
+ // `this` 在方法里指向当前 Vue 实例
+ alert('Hello ' + this.name + '!')
+ // `event` 是原生 DOM 事件
+ if (event) {
+ alert(event.target.tagName)
+ }
+ }
+ }
+})
+
+// 也可以用 JavaScript 直接调用方法
+example2.greet() // => 'Hello Vue.js!'
+```
+
+#### 内联处理器中的方法调用
+
+- 有时也需要在内联语句处理器中访问原始的 DOM 事件。可以用特殊变量 `$event` 把它传入方法
+
+```html
+
+
+
+
+
+
+
+```
+
+```js
+new Vue({
+ el: '#example-3',
+ methods: {
+ say: function (message) {
+ alert(message)
+ },
+ warn: function (message, event) {
+ // 现在我们可以访问原生事件对象
+ if (event) {
+ event.preventDefault()
+ }
+ alert(message)
+ }
+ }
+})
+```
+
+#### [事件修饰符](https://cn.vuejs.org/v2/guide/events.html#事件修饰符)
+
+- 键盘按键处理
+- 鼠标按键处理
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+...
+
+
+
+...
+
+
+
+
+
+
+
+...
+
+
+
+
+
+
+
+
+// 可以使用 `v-on:keyup.f1`
+Vue.config.keyCodes.f1 = 112
+
+
+
+
+Do something
+
+```
+
diff --git a/vue/8-表单输入绑定.md b/vue/8-表单输入绑定.md
new file mode 100644
index 0000000..2eb3748
--- /dev/null
+++ b/vue/8-表单输入绑定.md
@@ -0,0 +1,27 @@
+## v-model
+
+```html
+
+
+ Selected: {{ selected }}
+
+```
+
+```js
+new Vue({
+ el: 'example-6',
+ data: {
+ selected: 'A',
+ options: [
+ { text: 'One', value: 'A' },
+ { text: 'Two', value: 'B' },
+ { text: 'Three', value: 'C' }
+ ]
+ }
+})
+```
+
diff --git a/vue/9-组件基础.md b/vue/9-组件基础.md
new file mode 100644
index 0000000..f84e1e0
--- /dev/null
+++ b/vue/9-组件基础.md
@@ -0,0 +1,56 @@
+- 因为组件是可复用的 Vue 实例,所以它们与 `new Vue` 接收相同的选项,例如 `data`、`computed`、`watch`、`methods` 以及生命周期钩子等。仅有的例外是像 `el` 这样根实例特有的选项。
+- 一个组件的 `data` 选项必须是一个函数,因此每个实例可以维护一份被返回对象的独立的拷贝
+- 通过prop向组件传递数据,`v-on` 监听子组件实例的任意事件
+- [从一个 API 获取博文列表](https://codesandbox.io/s/github/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-component-blog-post-example)
+
+```js
+// 定义一个名为 button-counter 的新组件
+Vue.component('button-counter', {
+ data: function () {
+ return {
+ count: 0
+ }
+ },
+ template: ''
+})
+
+Vue.component('blog-post', {
+ props: ['title'],
+ template: '{{ title }}
'
+})
+```
+
+```html
+
+
+
+
+
+
+
+
+
+```
+
+```html
+new Vue({ el: '#components-demo' })
+
+new Vue({
+ el: '#blog-post-demo',
+ data: {
+ posts: [
+ { id: 1, title: 'My journey with Vue' },
+ { id: 2, title: 'Blogging with Vue' },
+ { id: 3, title: 'Why Vue is so fun' }
+ ]
+ }
+})
+```
+
+## [动态组件](https://cn.vuejs.org/v2/guide/components.html#动态组件)
+
+https://codesandbox.io/s/github/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-dynamic-components
\ No newline at end of file
diff --git a/vue/erp-web.md b/vue/erp-web.md
index ed47994..b0cd7e5 100644
--- a/vue/erp-web.md
+++ b/vue/erp-web.md
@@ -1,4 +1,4 @@
-目录查看
+### 目录查看
1. node_modules:安装依赖打包
2. public:图片文件,index.html
@@ -33,4 +33,77 @@
16. package.json:包管理,启动打包
17. vue.config.js:
-vue-cli-service serve
\ No newline at end of file
+vue-cli-service serve
+
+### 总结
+
+当配置baseURL时,代理不生效。
+
+```js
+const request = axios.create({
+ timeout: 30000, // 请求超时时间
+ baseURL: process.env.VUE_APP_URL,
+ withCredentials: true
+});
+
+proxy: {
+ '/': { // 代理api
+ target: 'http://localhost:8085', // 服务器api地址
+ changeOrigin: true//, // 是否跨域
+ // pathRewrite: {
+ // '^/': 'http://qiankun.bj-fanuc.com.cn/finance-admin/charts/selectChartDataByPageModel' // 路径重写
+ // }
+ }
+}
+```
+
+## 启动跟踪
+
+```js
+npm run dev
+```
+
+文件:package.json
+
+```json
+"dev": "webpack-dev-server --inline --progress --module-bind production --config build/webpack.dev.conf.js "
+```
+
+文件:build/webpack.dev.conf.js
+
+```js
+ // these devServer options should be customized in /config/index.js
+ devServer: {
+ clientLogLevel: 'warning',
+ historyApiFallback: {
+ rewrites: [
+ { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
+ ],
+ },
+ hot: true,
+ contentBase: false, // since we use CopyWebpackPlugin.
+ compress: true,
+ host: HOST || config.dev.host,
+ port: PORT || config.dev.port,
+ open: config.dev.autoOpenBrowser,
+ overlay: config.dev.errorOverlay
+ ? { warnings: false, errors: true }
+ : false,
+ publicPath: config.dev.assetsPublicPath,
+ proxy: config.dev.proxyTable,
+ quiet: true, // necessary for FriendlyErrorsPlugin
+ watchOptions: {
+ poll: config.dev.poll,
+ },
+ proxy: {
+ '/*': { // 代理api
+ target: 'http://localhost8080/', // 服务器api地址
+ changeOrigin: true, // 是否跨域
+ pathRewrite: {
+ '^/*': 'http://localhost:8081/' // 路径重写
+ }
+ }
+ }
+ },
+```
+
diff --git a/vue/img/lifecycle.png b/vue/img/lifecycle.png
new file mode 100644
index 0000000..f8cd62c
Binary files /dev/null and b/vue/img/lifecycle.png differ
diff --git a/vue/webpack打包.md b/vue/webpack打包.md
new file mode 100644
index 0000000..e9e6186
--- /dev/null
+++ b/vue/webpack打包.md
@@ -0,0 +1,98 @@
+## 基本参数
+
+[基本参数说明](https://webpack.docschina.org/concepts)
+
+1. 入口(entry)
+2. 输出(output)
+3. loader
+4. 插件(plugin)
+5. 模式(mode)
+6. 浏览器兼容性(browser compatibility)
+7. 环境(environment)
+
+## 默认配置
+
+1. 入口起点为 `src/index.js`
+2. 然后会在 `dist/main.js` 输出结果
+3. 并且在生产环境开启压缩和优化
+4. 通常你的项目还需要继续扩展此能力,为此你可以在项目根目录下创建一个 `webpack.config.js` 文件,然后 webpack 会自动使用它。
+
+[webpack.config.js配置](https://webpack.docschina.org/configuration)
+
+**“webpack 配置的可扩展”** 是指,这些配置可以重复使用,并且可以与其他配置组合使用。这是一种流行的技术,用于将关注点从环境(environment)、构建目标(build target)、运行时(runtime)中分离。然后使用专门的工具(如 [webpack-merge](https://github.com/survivejs/webpack-merge))将它们合并起来。
+
+- 使用 JavaScript 控制流表达式,例如 `?:` 操作符
+- 精心编写的 **模块** 提供了可靠的抽象和封装界限,使得应用程序中每个模块都具备了条理清晰的设计和明确的目的。
+- 应保证 loader 的先后顺序:[`'style-loader'`](https://webpack.docschina.org/loaders/style-loader) 在前,而 [`'css-loader'`](https://webpack.docschina.org/loaders/css-loader) 在后
+
+## 基础文件
+
+1. index.html是主入口
+2. app.js是我们写的模块,并依据CommonJS规范导出这个模块
+3. main.js其实是一个组件,它的目的是将我们写的一些代码模块返回并插入到页面中
+
+ 不兼容问题升级
+
+```js
+npm i -D html-webpack-plugin@webpack-contrib/html-webpack-plugin
+
+```
+
+临时删除一些错误包
+
+```
+ "eslint-loader": "^2.0.0",
+ "element-ui": "^2.15.7",
+ "less-loader": "6.0.0",
+ "jest": "^27.4.5",
+ "jest-serializer-vue": "^0.3.0",
+ "babel-jest": "^27.4.5",
+ "vue-jest": "^1.0.2",
+ "friendly-errors-webpack-plugin": "2.0.0-beta.2",
+ "uglifyjs-webpack-plugin": "2.2.0",
+ "babel-plugin-transform-runtime": "^7.14.0",
+ "@babel/core": "^7.12.3",
+ "@babel/plugin-transform-runtime": "7.12.13",
+ "@babel/preset-env": "^7.16.7",
+ "babel-eslint": "^10.0.1",
+ "babel-helper-vue-jsx-merge-props": "^2.0.3",
+ "babel-plugin-dynamic-import-node": "^1.2.0",
+ "babel-plugin-syntax-jsx": "^6.18.0",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
+ "babel-plugin-transform-vue-jsx": "4.0.1",
+ "babel-preset-env": "^1.3.2",
+ "babel-preset-stage-2": "^6.22.0",
+ "babel-register": "^6.22.0",
+
+ "@babel/preset-env":"7.16.7"
+ "babel-plugin-react-intl": "^8.2.15",
+
+
+ npm instal babel-preset-env
+ npm install babel-preset-stage-2
+
+ "babel-plugin-transform-runtime": "^6.23.0",
+ "babel-plugin-transform-vue-jsx": "^4.0.1",
+ "babel-preset-env": "^1.7.0",
+ "babel-preset-stage-2": "^6.24.1",
+
+
+ -----------------------------------
+ "@babel/core": "^7.16.7",
+ "@babel/preset-env": "^7.16.7",
+ "babel-loader": "^8.2.3",
+ "babel-preset-stage-2": "7.0.0-beta.3",
+ "babel-runtime": "6.26.0",
+
+ "babel-helper-vue-jsx-merge-props": "^2.0.3",
+ "babel-plugin-syntax-jsx": "^6.18.0",
+ "babel-plugin-transform-runtime": "^6.23.0",
+ "babel-plugin-transform-vue-jsx": "^3.7.0",
+ "babel-preset-env": "^1.7.0",
+ "@babel/preset-stage-2": "^7.8.3",
+
+
+
+TypeError: src/main.js: this.setDynamic is not a function
+```
+
diff --git a/vue/深入了解组件/1-组件注册.md b/vue/深入了解组件/1-组件注册.md
new file mode 100644
index 0000000..87b7883
--- /dev/null
+++ b/vue/深入了解组件/1-组件注册.md
@@ -0,0 +1,36 @@
+组件类似与java中的类(对象)。
+
+#### 全局组件
+
+```js
+Vue.component('component-a', { /* ... */ })
+Vue.component('component-b', { /* ... */ })
+Vue.component('component-c', { /* ... */ })
+
+new Vue({ el: '#app' })
+```
+
+```html
+
+
+
+
+
+```
+
+#### 局部组件
+
+```js
+var ComponentA = { /* ... */ }
+var ComponentB = { /* ... */ }
+var ComponentC = { /* ... */ }
+
+new Vue({
+ el: '#app',
+ components: {
+ 'component-a': ComponentA,
+ 'component-b': ComponentB
+ }
+})
+```
+
diff --git a/从放弃到入门系列.md b/从放弃到入门系列.md
index 5db02e9..fc8e53a 100644
--- a/从放弃到入门系列.md
+++ b/从放弃到入门系列.md
@@ -19,4 +19,5 @@
17. 分治
18. ~~解决方案文档~~
19. 修改接口确保之前逻辑不变
-19. EntityGraph多看源码,注释下同级别有类似注释。
\ No newline at end of file
+19. EntityGraph多看源码,注释下同级别有类似注释。
+19. 用心做好每件事,每个人每件事,都值得被认真对待。
\ No newline at end of file