[TOC]
*****
## web-runtim web運行時
>[info] import
~~~
;(導入)運行時基礎
import Vue from 'core/index'
import { createPatchFunction } from 'core/vdom/patch'
import * as nodeOps from 'web/runtime/node-ops'
import platformDirectives from 'web/runtime/directives/index'
import baseModules from 'core/vdom/modules/index'
import platformModules from 'web/runtime/modules/index'
import { query, isUnknownElement, isReservedTag } from 'web/util/index'
import { inBrowser } from 'core/util/env'
~~~
>[info] module
~~~
;核心配置擴展
Vue.config.isUnknownElement = isUnknownElement
Vue.config.isReservedTag = isReservedTag
;核心選項擴展
Vue.options.directives = platformDirectives
;創建patch函數
const modules = baseModules.concat(platformModules)
Vue.prototype.__patch__ = inBrowser
? createPatchFunction({ nodeOps, modules })
: function noop () {}
;Vue.$mount修正
Vue.prototype.$mount = function (el) {
this.$el = el && query(el)
this._mount()
}
;導出運行時Vue
export default Vue
~~~
>[info] export
~~~
;(導出)運行時Vue
export default Vue
~~~
- 概述
- 框架結構
- 編譯入口(\entries)
- web-compiler.js(web編譯)
- web-runtime.js(web運行時)
- web-runtime-wih-compiler.js(web編譯運行)
- web-server-renderer.js(web服務器渲染)
- 核心實現 (\core)
- index.js(核心入口)
- config.js(核心配置)
- core\util(核心工具)
- core\observer(雙向綁定)
- core\vdom(虛擬DOM)
- core\global-api(核心api)
- core\instance(核心實例)
- 模板編譯(\compiler)
- compiler\parser(模板解析)
- events.js(事件解析)
- helper.js(解析助手)
- directives\ref.js(ref指令)
- optimizer.js(解析優化)
- codegen.js(渲染生成)
- index.js(模板編譯入口)
- web渲染(\platforms\web)
- compiler(web編譯目錄)
- runtime(web運行時目錄)
- server(web服務器目錄)
- util(web工具目錄)
- 服務器渲染(\server)
- render-stream.js(流式渲染)
- render.js(服務器渲染函數)
- create-renderer.js(創建渲染接口)
- 框架流程
- Vue初始化
- Vue視圖數據綁定
- Vue數據變化刷新
- Vue視圖操作刷新
- 框架工具
- 基礎工具(\shared)
- 模板編譯助手
- 核心實例工具
- Web渲染工具
- 基礎原理
- dom
- string
- array
- function
- object
- es6
- 模塊(Module)
- 類(Class)
- 函數(箭頭)
- 字符串(擴展)
- 代理接口(Proxy)
- 數據綁定基礎
- 數據綁定實現
- mvvm簡單實現
- mvvm簡單使用
- vdom算法
- vdom實現
- vue源碼分析資料