How do Meteor's blaze and Famo.us play together?

后端 未结 5 1623
[愿得一人]
[愿得一人] 2021-02-02 00:48

2 Technologies:

  • Meteor with the blaze templating engine
  • Famo.us with their awesome gui framework

I come from the meteor side, I personally

5条回答
  •  鱼传尺愫
    2021-02-02 01:28

    Here's a vanilla implementation without having to use a library.

    Create and empty div for blaze to render into and pass that as content to your famous surface. you now have a reactive content in famous.

    mainContext = famous.core.Engine.createContext();
    
      div = document.createElement('div');
      Blaze.render(Template.moo,div)
    
      surface = new famous.core.Surface(  
        content: div,
        size: [200, 200],
        properties: {
          backgroundColor: 'rgb(240, 238, 233)',
          textAlign: 'center',
          padding: '5px',
          border: '2px solid rgb(210, 208, 203)',
          marginTop: '50px',
          marginLeft: '50px'
        }
      )
    
      mainContext.add(surface)
    

提交回复
热议问题