V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
linshudery
V2EX  ›  问与答

问个 vue.js 源码语法的问题

  •  
  •   linshudery · 2017-05-12 23:40:44 +08:00 · 5158 次点击
    这是一个创建于 2548 天前的主题,其中的信息可能已经有所发展或是发生改变。

    export function initMixin (Vue: Class<component>) { Vue.prototype._init = function (options?: Object) { const vm: Component = this .... }

    请问这个 Vue: vm:冒号和 Class<component>是什么意思? 这是 Javascript 的语法吗

    2 条回复    2017-05-13 00:25:43 +08:00
    seki
        1
    seki  
       2017-05-13 00:14:07 +08:00
    这个是 flow 的 type 语法,vue 用了 flow 做静态类型检查
    https://flow.org/
    linshudery
        2
    linshudery  
    OP
       2017-05-13 00:25:43 +08:00
    谢谢,了解了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2303 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:16 · PVG 08:16 · LAX 17:16 · JFK 20:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.