annotate entries

This commit is contained in:
Evan You 2016-05-12 12:34:54 -04:00
parent 7ac7cae195
commit b926b9e7cd
5 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,10 @@
{
"root": true,
"parser": "babel-eslint",
"extends": "vue"
"extends": "vue",
"plugins": ["flow-vars"],
"rules": {
"flow-vars/define-flow-type": 1,
"flow-vars/use-flow-type": 1
}
}

View File

@ -49,6 +49,7 @@
"entities": "1.1.x",
"eslint": "2.9.x",
"eslint-config-vue": "1.0.x",
"eslint-plugin-flow-vars": "^0.4.0",
"flow-bin": "^0.24.2",
"http-server": "0.9.x",
"isparta-loader": "2.0.x",

View File

@ -1,3 +1,5 @@
/* @flow */
import config from 'core/config'
import { warn, cached } from 'core/util/index'
import { query } from 'web/util/index'
@ -7,7 +9,7 @@ import { compileToFunctions } from './web-compiler'
const idToTemplate = cached(id => query(id).innerHTML)
const mount = Vue.prototype.$mount
Vue.prototype.$mount = function (el) {
Vue.prototype.$mount = function (el?: string | Element): Vue {
el = el && query(el)
const options = this.$options
// resolve template/el and convert to render function
@ -42,11 +44,8 @@ Vue.prototype.$mount = function (el) {
/**
* Get outerHTML of elements, taking care
* of SVG elements in IE as well.
*
* @param {Element} el
* @return {String}
*/
function getOuterHTML (el) {
function getOuterHTML (el: Element): string {
if (el.outerHTML) {
return el.outerHTML
} else {

View File

@ -1,3 +1,5 @@
/* @flow */
import Vue from 'core/index'
import config from 'core/config'
import { createPatchFunction } from 'core/vdom/patch'
@ -22,7 +24,7 @@ Vue.prototype.__patch__ = config._isServer
: createPatchFunction({ nodeOps, modules })
// wrap mount
Vue.prototype.$mount = function (el) {
Vue.prototype.$mount = function (el?: string | Element): Vue {
this.$el = el && query(el)
return this._mount()
}

View File

@ -1,9 +1,14 @@
/* @flow */
import { createRenderer } from 'server/create-renderer'
import { isUnaryTag } from 'web/util/index'
import modules from 'web/server/modules/index'
import baseDirectives from 'web/server/directives/index'
export default function publicCreateRenderer (options = {}) {
export default function publicCreateRenderer (options?: Object = {}): {
renderToString: Function,
renderToStream: Function
} {
// user can provide server-side implementations for custom directives
// when creating the renderer.
const directives = Object.assign(baseDirectives, options.directives)