linshudery
V2EX  ›  问与答

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

  •  
  •   linshudery · May 12, 2017 · 5658 views
    This topic created in 3286 days ago, the information mentioned may be changed or developed.

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

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

    2 replies    2017-05-13 00:25:43 +08:00
    seki
        1
    seki  
       May 13, 2017
    这个是 flow 的 type 语法,vue 用了 flow 做静态类型检查
    https://flow.org/
    linshudery
        2
    linshudery  
    OP
       May 13, 2017
    谢谢,了解了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:16 · PVG 06:16 · LAX 15:16 · JFK 18:16
    ♥ Do have faith in what you're doing.