├── test ├── weex │ ├── compiler │ │ ├── append.spec.js │ │ ├── compile.spec.js │ │ └── class.spec.js │ ├── .eslintrc │ ├── jasmine.json │ └── helpers │ │ └── index.js ├── ssr │ ├── fixtures │ │ ├── error.js │ │ ├── app.js │ │ └── cache.js │ ├── .eslintrc │ └── jasmine.json ├── e2e │ ├── .eslintrc │ ├── specs │ │ ├── markdown.js │ │ ├── commits.js │ │ ├── modal.js │ │ ├── svg.js │ │ └── select2.js │ └── runner.js ├── helpers │ ├── .eslintrc │ ├── vdom.js │ ├── trigger-event.js │ ├── to-equal.js │ ├── classlist.js │ ├── wait-for-update.js │ └── to-have-been-warned.js └── unit │ ├── .eslintrc │ ├── index.js │ ├── features │ ├── directives │ │ ├── cloak.spec.js │ │ ├── model-file.spec.js │ │ ├── model-dynamic.spec.js │ │ ├── pre.spec.js │ │ ├── model-parse.spec.js │ │ ├── text.spec.js │ │ ├── static-style-parser.spec.js │ │ └── html.spec.js │ ├── instance │ │ ├── init.spec.js │ │ ├── render-proxy.spec.js │ │ ├── methods-events.spec.js │ │ └── properties.spec.js │ ├── global-api │ │ ├── compile.spec.js │ │ ├── use.spec.js │ │ ├── mixin.spec.js │ │ ├── assets.spec.js │ │ └── set-delete.spec.js │ ├── options │ │ ├── methods.spec.js │ │ ├── propsData.spec.js │ │ ├── parent.spec.js │ │ ├── extends.spec.js │ │ ├── render.spec.js │ │ ├── name.spec.js │ │ ├── _scopeId.spec.js │ │ └── template.spec.js │ └── transition │ │ └── inject-styles.js │ └── modules │ ├── util │ └── next-tick.spec.js │ └── vdom │ ├── modules │ ├── directive.spec.js │ ├── style.spec.js │ └── events.spec.js │ └── patch │ └── element.spec.js ├── .eslintignore ├── src ├── platforms │ ├── weex │ │ ├── runtime │ │ │ ├── directives │ │ │ │ └── index.js │ │ │ ├── modules │ │ │ │ ├── index.js │ │ │ │ ├── events.js │ │ │ │ ├── attrs.js │ │ │ │ ├── style.js │ │ │ │ └── class.js │ │ │ ├── config.js │ │ │ ├── patch.js │ │ │ ├── index.js │ │ │ └── node-ops.js │ │ ├── compiler │ │ │ ├── directives │ │ │ │ ├── index.js │ │ │ │ └── model.js │ │ │ └── modules │ │ │ │ ├── index.js │ │ │ │ ├── append.js │ │ │ │ └── class.js │ │ └── util │ │ │ └── index.js │ └── web │ │ ├── server │ │ ├── directives │ │ │ ├── index.js │ │ │ └── show.js │ │ ├── modules │ │ │ ├── index.js │ │ │ ├── class.js │ │ │ ├── style.js │ │ │ ├── attrs.js │ │ │ └── dom-props.js │ │ └── util.js │ │ ├── runtime │ │ ├── directives │ │ │ ├── index.js │ │ │ └── show.js │ │ ├── components │ │ │ └── index.js │ │ ├── modules │ │ │ ├── index.js │ │ │ ├── class.js │ │ │ ├── events.js │ │ │ ├── attrs.js │ │ │ └── style.js │ │ ├── patch.js │ │ ├── class-util.js │ │ └── node-ops.js │ │ ├── compiler │ │ ├── modules │ │ │ ├── index.js │ │ │ ├── class.js │ │ │ └── style.js │ │ ├── directives │ │ │ ├── index.js │ │ │ ├── html.js │ │ │ └── text.js │ │ └── util.js │ │ └── util │ │ ├── compat.js │ │ ├── index.js │ │ ├── attrs.js │ │ ├── class.js │ │ └── style.js ├── core │ ├── components │ │ ├── index.js │ │ └── keep-alive.js │ ├── vdom │ │ ├── modules │ │ │ ├── index.js │ │ │ └── ref.js │ │ └── helpers │ │ │ ├── index.js │ │ │ ├── merge-hook.js │ │ │ └── update-listeners.js │ ├── util │ │ ├── index.js │ │ ├── lang.js │ │ └── debug.js │ ├── global-api │ │ ├── mixin.js │ │ ├── use.js │ │ ├── assets.js │ │ ├── index.js │ │ └── extend.js │ ├── index.js │ ├── instance │ │ ├── index.js │ │ └── proxy.js │ └── observer │ │ ├── dep.js │ │ └── array.js ├── compiler │ ├── directives │ │ ├── index.js │ │ └── bind.js │ ├── parser │ │ ├── entity-decoder.js │ │ └── text-parser.js │ └── index.js ├── server │ ├── write.js │ ├── run-in-vm.js │ ├── create-bundle-renderer.js │ ├── create-renderer.js │ └── render-stream.js └── entries │ ├── web-server-renderer.js │ ├── weex-compiler.js │ ├── web-compiler.js │ └── web-runtime.js ├── types ├── typings.json ├── plugin.d.ts ├── test │ ├── plugin-test.ts │ ├── tsconfig.json │ ├── augmentation-test.ts │ └── vue-test.ts ├── index.d.ts └── vnode.d.ts ├── circle.yml ├── .babelrc ├── benchmarks ├── dbmon │ ├── lib │ │ ├── styles.css │ │ └── monitor.js │ ├── app.js │ └── index.html ├── big-table │ └── demo.css └── ssr │ ├── renderToString.js │ ├── README.md │ ├── renderToStream.js │ └── common.js ├── .github ├── PULL_REQUEST_TEMPLATE.md └── CODE_OF_CONDUCT.md ├── .gitignore ├── packages ├── weex-vue-framework │ ├── README.md │ └── package.json ├── weex-template-compiler │ ├── README.md │ ├── package.json │ └── index.js ├── vue-server-renderer │ ├── index.js │ └── package.json └── vue-template-compiler │ ├── package.json │ └── index.js ├── .eslintrc ├── flow ├── ssr.js ├── modules.js ├── global-api.js ├── vnode.js └── options.js ├── examples ├── svg │ ├── style.css │ ├── index.html │ └── svg.js ├── firebase │ ├── style.css │ ├── index.html │ └── app.js ├── markdown │ ├── style.css │ └── index.html ├── elastic-header │ └── style.css ├── commits │ ├── app.js │ └── index.html ├── todomvc │ └── readme.md ├── grid │ ├── style.css │ ├── index.html │ └── grid.js ├── modal │ ├── style.css │ └── index.html └── tree │ ├── tree.js │ └── index.html ├── .flowconfig └── LICENSE /test/weex/compiler/append.spec.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | flow 2 | dist 3 | packages 4 | -------------------------------------------------------------------------------- /test/ssr/fixtures/error.js: -------------------------------------------------------------------------------- 1 | throw new Error('foo') 2 | -------------------------------------------------------------------------------- /src/platforms/weex/runtime/directives/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | } 3 | -------------------------------------------------------------------------------- /test/e2e/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "indent": 0 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /types/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "main": "index.d.ts" 4 | } 5 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: 6 4 | 5 | test: 6 | override: 7 | - bash build/ci.sh 8 | -------------------------------------------------------------------------------- /src/core/components/index.js: -------------------------------------------------------------------------------- 1 | import KeepAlive from './keep-alive' 2 | 3 | export default { 4 | KeepAlive 5 | } 6 | -------------------------------------------------------------------------------- /src/platforms/web/server/directives/index.js: -------------------------------------------------------------------------------- 1 | import show from './show' 2 | 3 | export default { 4 | show 5 | } 6 | -------------------------------------------------------------------------------- /src/platforms/weex/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | 3 | export default { 4 | model 5 | } 6 | -------------------------------------------------------------------------------- /test/helpers/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "globals": { 6 | "waitForUpdate": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/core/vdom/modules/index.js: -------------------------------------------------------------------------------- 1 | import directives from './directives' 2 | import ref from './ref' 3 | 4 | export default [ 5 | ref, 6 | directives 7 | ] 8 | -------------------------------------------------------------------------------- /src/platforms/web/runtime/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | import show from './show' 3 | 4 | export default { 5 | model, 6 | show 7 | } 8 | -------------------------------------------------------------------------------- /src/platforms/web/compiler/modules/index.js: -------------------------------------------------------------------------------- 1 | import klass from './class' 2 | import style from './style' 3 | 4 | export default [ 5 | klass, 6 | style 7 | ] 8 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "flow-vue"], 3 | "plugins": ["transform-vue-jsx"], 4 | "ignore": [ 5 | "dist/*.js", 6 | "packages/**/*.js" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/helpers/vdom.js: -------------------------------------------------------------------------------- 1 | import VNode from 'core/vdom/vnode' 2 | 3 | window.createTextVNode = function (text) { 4 | return new VNode(undefined, undefined, undefined, text) 5 | } 6 | -------------------------------------------------------------------------------- /test/ssr/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "plugins": ["jasmine"], 6 | "rules": { 7 | "jasmine/no-focused-tests": 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/weex/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "plugins": ["jasmine"], 6 | "rules": { 7 | "jasmine/no-focused-tests": 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /benchmarks/dbmon/lib/styles.css: -------------------------------------------------------------------------------- 1 | .Query { 2 | position: relative; 3 | } 4 | 5 | .Query:hover .popover { 6 | left: -100%; 7 | width: 100%; 8 | display: block; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import bind from './bind' 4 | import { noop } from 'shared/util' 5 | 6 | export default { 7 | bind, 8 | cloak: noop 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | *.log 4 | explorations 5 | TODOs.md 6 | dist/*.gz 7 | dist/*.map 8 | dist/vue.common.min.js 9 | test/e2e/reports 10 | test/e2e/screenshots 11 | coverage 12 | -------------------------------------------------------------------------------- /src/platforms/web/runtime/components/index.js: -------------------------------------------------------------------------------- 1 | import Transition from './transition' 2 | import TransitionGroup from './transition-group' 3 | 4 | export default { 5 | Transition, 6 | TransitionGroup 7 | } 8 | -------------------------------------------------------------------------------- /src/platforms/web/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | import text from './text' 3 | import html from './html' 4 | 5 | export default { 6 | model, 7 | text, 8 | html 9 | } 10 | -------------------------------------------------------------------------------- /test/weex/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test/weex", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "../../node_modules/babel-register/lib/node.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/platforms/weex/compiler/modules/index.js: -------------------------------------------------------------------------------- 1 | import klass from './class' 2 | import style from './style' 3 | import append from './append' 4 | 5 | export default [ 6 | klass, 7 | style, 8 | append 9 | ] 10 | -------------------------------------------------------------------------------- /packages/weex-vue-framework/README.md: -------------------------------------------------------------------------------- 1 | # weex-vue-framework 2 | 3 | > This package is auto-generated. For pull requests please see [src/entries/weex-framework.js](https://github.com/vuejs/vue/blob/dev/src/entries/weex-framework.js). 4 | -------------------------------------------------------------------------------- /packages/weex-template-compiler/README.md: -------------------------------------------------------------------------------- 1 | # weex-template-compiler 2 | 3 | > This package is auto-generated. For pull requests please see [src/entries/weex-compiler.js](https://github.com/vuejs/vue/blob/dev/src/entries/weex-compiler.js). 4 | -------------------------------------------------------------------------------- /src/core/util/index.js: -------------------------------------------------------------------------------- 1 | export * from 'shared/util' 2 | export * from './lang' 3 | export * from './env' 4 | export * from './options' 5 | export * from './debug' 6 | export * from './props' 7 | export { defineReactive } from '../observer/index' 8 | -------------------------------------------------------------------------------- /types/plugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Vue as _Vue } from "./vue"; 2 | 3 | export type PluginFunction = (Vue: typeof _Vue, options?: T) => void; 4 | 5 | export interface PluginObject { 6 | install: PluginFunction; 7 | [key: string]: any; 8 | } 9 | -------------------------------------------------------------------------------- /test/helpers/trigger-event.js: -------------------------------------------------------------------------------- 1 | window.triggerEvent = function triggerEvent (target, event, process) { 2 | var e = document.createEvent('HTMLEvents') 3 | e.initEvent(event, true, true) 4 | if (process) process(e) 5 | target.dispatchEvent(e) 6 | } 7 | -------------------------------------------------------------------------------- /src/compiler/parser/entity-decoder.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | let decoder 4 | 5 | export function decode (html: string): string { 6 | decoder = decoder || document.createElement('div') 7 | decoder.innerHTML = html 8 | return decoder.textContent 9 | } 10 | -------------------------------------------------------------------------------- /src/platforms/weex/runtime/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import klass from './class' 3 | import events from './events' 4 | import style from './style' 5 | 6 | export default [ 7 | attrs, 8 | klass, 9 | events, 10 | style 11 | ] 12 | -------------------------------------------------------------------------------- /src/core/global-api/mixin.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { mergeOptions } from '../util/index' 4 | 5 | export function initMixin (Vue: GlobalAPI) { 6 | Vue.mixin = function (mixin: Object) { 7 | this.options = mergeOptions(this.options, mixin) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/platforms/web/server/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import domProps from './dom-props' 3 | import klass from './class' 4 | import style from './style' 5 | 6 | export default [ 7 | attrs, 8 | domProps, 9 | klass, 10 | style 11 | ] 12 | -------------------------------------------------------------------------------- /src/platforms/web/server/directives/show.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export default function show (node: VNodeWithData, dir: VNodeDirective) { 4 | if (!dir.value) { 5 | const style: any = node.data.style || (node.data.style = {}) 6 | style.display = 'none' 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/big-table/demo.css: -------------------------------------------------------------------------------- 1 | form { 2 | margin-bottom: 15px ; 3 | } 4 | 5 | td.hidden { 6 | color: #ccc; 7 | } 8 | 9 | table.filtered td.item { 10 | background-color: #FFFFBF; 11 | } 12 | 13 | table.filtered td.item.hidden { 14 | background-color: transparent; 15 | } 16 | -------------------------------------------------------------------------------- /src/platforms/web/compiler/directives/html.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addProp } from 'compiler/helpers' 4 | 5 | export default function html (el: ASTElement, dir: ASTDirective) { 6 | if (dir.value) { 7 | addProp(el, 'innerHTML', `_s(${dir.value})`) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/platforms/web/compiler/directives/text.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addProp } from 'compiler/helpers' 4 | 5 | export default function text (el: ASTElement, dir: ASTDirective) { 6 | if (dir.value) { 7 | addProp(el, 'textContent', `_s(${dir.value})`) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "globals": { 6 | "waitForUpdate": true, 7 | "triggerEvent": true, 8 | "createTextVNode": true 9 | }, 10 | "plugins": ["jasmine"], 11 | "rules": { 12 | "jasmine/no-focused-tests": 2 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/ssr/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test/ssr", 3 | "spec_files": [ 4 | "ssr-env.spec.js", 5 | "ssr-string.spec.js", 6 | "ssr-stream.spec.js", 7 | "ssr-bundle-render.spec.js" 8 | ], 9 | "helpers": [ 10 | "../../node_modules/babel-register/lib/node.js" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /src/compiler/directives/bind.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export default function bind (el: ASTElement, dir: ASTDirective) { 4 | el.wrapData = (code: string) => { 5 | return `_b(${code},'${el.tag}',${dir.value}${ 6 | dir.modifiers && dir.modifiers.prop ? ',true' : '' 7 | })` 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/platforms/web/server/modules/class.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { genClassForVnode } from 'web/util/index' 4 | 5 | export default function renderClass (node: VNodeWithData): ?string { 6 | const classList = genClassForVnode(node) 7 | if (classList) { 8 | return ` class="${classList}"` 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "babel-eslint", 4 | "extends": "vue", 5 | "plugins": ["flowtype"], 6 | "globals": { 7 | "__WEEX__": true 8 | }, 9 | "rules": { 10 | "no-useless-escape": 0, 11 | "flowtype/define-flow-type": 1, 12 | "flowtype/use-flow-type": 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/ssr/fixtures/app.js: -------------------------------------------------------------------------------- 1 | import Vue from '../../../dist/vue.runtime.common.js' 2 | 3 | export default context => { 4 | return new Promise(resolve => { 5 | context.msg = 'hello' 6 | resolve(new Vue({ 7 | render (h) { 8 | return h('div', context.url) 9 | } 10 | })) 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /benchmarks/dbmon/app.js: -------------------------------------------------------------------------------- 1 | var app = new Vue({ 2 | el: '#app', 3 | data: { 4 | databases: [] 5 | } 6 | }) 7 | 8 | function loadSamples() { 9 | app.databases = Object.freeze(ENV.generateData().toArray()); 10 | Monitoring.renderRate.ping(); 11 | setTimeout(loadSamples, ENV.timeout); 12 | } 13 | 14 | loadSamples() 15 | -------------------------------------------------------------------------------- /src/core/vdom/helpers/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export * from './merge-hook' 4 | export * from './update-listeners' 5 | export * from './normalize-children' 6 | 7 | export function getFirstComponentChild (children: ?Array): ?VNodeWithData { 8 | return children && children.filter(c => c && c.componentOptions)[0] 9 | } 10 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | require('es6-promise/auto') 2 | 3 | // import all helpers 4 | const helpersContext = require.context('../helpers', true) 5 | helpersContext.keys().forEach(helpersContext) 6 | 7 | // require all test files 8 | const testsContext = require.context('./', true, /\.spec$/) 9 | testsContext.keys().forEach(testsContext) 10 | -------------------------------------------------------------------------------- /src/platforms/weex/runtime/config.js: -------------------------------------------------------------------------------- 1 | let latestNodeId = 1 2 | 3 | function TextNode (text) { 4 | this.instanceId = '' 5 | this.nodeId = latestNodeId++ 6 | this.parentNode = null 7 | this.nodeType = 3 8 | this.text = text 9 | } 10 | 11 | export default { 12 | TextNode, 13 | instances: {}, 14 | modules: {}, 15 | components: {} 16 | } 17 | -------------------------------------------------------------------------------- /src/core/index.js: -------------------------------------------------------------------------------- 1 | import Vue from './instance/index' 2 | import { initGlobalAPI } from './global-api/index' 3 | import { isServerRendering } from 'core/util/env' 4 | 5 | initGlobalAPI(Vue) 6 | 7 | Object.defineProperty(Vue.prototype, '$isServer', { 8 | get: isServerRendering 9 | }) 10 | 11 | Vue.version = '__VERSION__' 12 | 13 | export default Vue 14 | -------------------------------------------------------------------------------- /test/unit/features/directives/cloak.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Directive v-cloak', () => { 4 | it('should be removed after compile', () => { 5 | const el = document.createElement('div') 6 | el.setAttribute('v-cloak', '') 7 | const vm = new Vue({ el }) 8 | expect(vm.$el.hasAttribute('v-cloak')).toBe(false) 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /src/platforms/web/runtime/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import klass from './class' 3 | import events from './events' 4 | import domProps from './dom-props' 5 | import style from './style' 6 | import transition from './transition' 7 | 8 | export default [ 9 | attrs, 10 | klass, 11 | events, 12 | domProps, 13 | style, 14 | transition 15 | ] 16 | -------------------------------------------------------------------------------- /test/unit/features/instance/init.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Initialization', () => { 4 | it('without new', () => { 5 | try { Vue() } catch (e) {} 6 | expect('Vue is a constructor and should be called with the `new` keyword').toHaveBeenWarned() 7 | }) 8 | 9 | it('with new', () => { 10 | expect(new Vue() instanceof Vue).toBe(true) 11 | }) 12 | }) 13 | -------------------------------------------------------------------------------- /test/ssr/fixtures/cache.js: -------------------------------------------------------------------------------- 1 | import Vue from '../../../dist/vue.runtime.common.js' 2 | 3 | const app = { 4 | name: 'app', 5 | props: ['id'], 6 | serverCacheKey: props => props.id, 7 | render (h) { 8 | return h('div', '/test') 9 | } 10 | } 11 | 12 | export default () => { 13 | return Promise.resolve(new Vue({ 14 | render: h => h(app, { props: { id: 1 }}) 15 | })) 16 | } 17 | -------------------------------------------------------------------------------- /test/unit/features/directives/model-file.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Directive v-model file', () => { 4 | it('warn to use @change instead', () => { 5 | new Vue({ 6 | data: { 7 | file: '' 8 | }, 9 | template: '' 10 | }).$mount() 11 | expect('Use a v-on:change listener instead').toHaveBeenWarned() 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /test/unit/features/directives/model-dynamic.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Directive v-model dynamic input type', () => { 4 | it('should warn', function () { 5 | new Vue({ 6 | data: { 7 | type: 'text', 8 | text: 'hi' 9 | }, 10 | template: `` 11 | }).$mount() 12 | expect(`v-model does not support dynamic input types`).toHaveBeenWarned() 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /test/unit/features/global-api/compile.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Global API: compile', () => { 4 | it('should compile render functions', () => { 5 | const res = Vue.compile('
{{ msg }}
') 6 | const vm = new Vue({ 7 | data: { 8 | msg: 'hello' 9 | }, 10 | render: res.render, 11 | staticRenderFns: res.staticRenderFns 12 | }).$mount() 13 | expect(vm.$el.innerHTML).toContain('hello') 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /test/helpers/to-equal.js: -------------------------------------------------------------------------------- 1 | import { isEqual } from 'lodash' 2 | 3 | beforeEach(() => { 4 | jasmine.addMatchers({ 5 | // override built-in toEqual because it behaves incorrectly 6 | // on Vue-observed arrays in Safari 7 | toEqual: () => { 8 | return { 9 | compare: (a, b) => { 10 | const pass = isEqual(a, b) 11 | return { 12 | pass, 13 | message: `Expected ${a} to equal ${b}` 14 | } 15 | } 16 | } 17 | } 18 | }) 19 | }) 20 | -------------------------------------------------------------------------------- /src/platforms/web/runtime/patch.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import * as nodeOps from 'web/runtime/node-ops' 4 | import { createPatchFunction } from 'core/vdom/patch' 5 | import baseModules from 'core/vdom/modules/index' 6 | import platformModules from 'web/runtime/modules/index' 7 | 8 | // the directive module should be applied last, after all 9 | // built-in modules have been applied. 10 | const modules = platformModules.concat(baseModules) 11 | 12 | export const patch: Function = createPatchFunction({ nodeOps, modules }) 13 | -------------------------------------------------------------------------------- /types/test/plugin-test.ts: -------------------------------------------------------------------------------- 1 | import Vue = require("../index"); 2 | import { PluginFunction, PluginObject } from "../index"; 3 | 4 | class Option { 5 | prefix: string; 6 | suffix: string; 7 | } 8 | 9 | const plugin: PluginObject