2017-01-03 7 views
0

私は知りたい|演算子意味、誰も説明することができますか? ここではsrc /コア/ VDOM/vnode.js'|' vuejs src code "vnode.js"で意味する演算子ですか?

export default class VNode { 
 
    tag: string | void; 
 
    data: VNodeData | void; 
 
    children: ?Array<VNode>; 
 
    text: string | void; 
 
    elm: Node | void; 
 
    ns: string | void; 
 
    context: Component | void; // rendered in this component's scope 
 
    functionalContext: Component | void; // only for functional component root nodes 
 
    key: string | number | void; 
 
    componentOptions: VNodeComponentOptions | void; 
 
    child: Component | void; // component instance 
 
    parent: VNode | void; // component placeholder node 
 
    raw: boolean; // contains raw HTML? (server only) 
 
    isStatic: boolean; // hoisted static node 
 
    isRootInsert: boolean; // necessary for enter transition check 
 
    isComment: boolean; // empty comment placeholder? 
 
    isCloned: boolean; // is a cloned node? 
 
    isOnce: boolean; // is a v-once node?

+1

これらはフロータイプの定義で、javascript https://flowtype.org/にタイプを追加するプロジェクトです –

答えて

-1

でいくつかの短いコードスニペットはここだ| OR単項演算子です。 nsを意味

ns: string | void; 

はタイプstringのですが、stringが何らかの原因で定義されていない場合、それはタイプvoidのものであろう。これは、一部のブラウザのバージョンで定義されていない場合にのみ注意してください。

関連する問題