add Style node, interfaces

pull/5923/head
pmurray73 6 years ago committed by Tan Li Hau
parent 52b67a0497
commit d550c20662

@ -0,0 +1,22 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import { TemplateNode } from '../../interfaces';
import TemplateScope from './shared/TemplateScope';
import Component from '../Component';
// @paul
export default class Style extends Node {
type: 'Style';
name: string;
expression: Expression;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {
super(component, parent, scope, info);
this.name = info.name;
this.expression = info.expression
? new Expression(component, this, scope, info.expression)
: null;
}
}

@ -8,6 +8,7 @@ import Binding from './Binding';
import Body from './Body'; import Body from './Body';
import CatchBlock from './CatchBlock'; import CatchBlock from './CatchBlock';
import Class from './Class'; import Class from './Class';
import Style from './Style';
import Comment from './Comment'; import Comment from './Comment';
import DebugTag from './DebugTag'; import DebugTag from './DebugTag';
import EachBlock from './EachBlock'; import EachBlock from './EachBlock';
@ -62,6 +63,7 @@ export type INode = Action
| Slot | Slot
| SlotTemplate | SlotTemplate
| DefaultSlotTemplate | DefaultSlotTemplate
| Style
| Tag | Tag
| Text | Text
| ThenBlock | ThenBlock

@ -24,10 +24,12 @@ export interface MustacheTag extends BaseNode {
expression: Node; expression: Node;
} }
// @paul
export type DirectiveType = 'Action' export type DirectiveType = 'Action'
| 'Animation' | 'Animation'
| 'Binding' | 'Binding'
| 'Class' | 'Class'
| 'Style'
| 'EventHandler' | 'EventHandler'
| 'Let' | 'Let'
| 'Ref' | 'Ref'

Loading…
Cancel
Save