Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js 使用Ember动态加载和操作文档_Ember.js_Dynamic - Fatal编程技术网

Ember.js 使用Ember动态加载和操作文档

Ember.js 使用Ember动态加载和操作文档,ember.js,dynamic,Ember.js,Dynamic,我正在工作,想知道余烬是否适合这项任务 我想从SVG之间关系的描述转到单个SVG文档 程序需要动态加载文档,并在文档末尾递归插入自身 因此,从一个对象,如: [ { id: 1, image: 'base.svg', contains: [ { id: 2, position: { x: 50, y: 50 }, size: { width: 35, height: 35 } }, {

我正在工作,想知道余烬是否适合这项任务

我想从SVG之间关系的描述转到单个SVG文档

程序需要动态加载文档,并在文档末尾递归插入自身

因此,从一个对象,如:

[
  {
    id: 1,
    image: 'base.svg',
    contains: [
      {
        id: 2,
        position: { x: 50, y: 50 },
        size: { width: 35, height: 35 }
      },
      {
        id: 3,
        position: { x: 150, y: 150 },
        size: { width: 40, height: 40 }
      }
    ]
  },
  {
    id: 2,
    image: 'kitchen.svg'
  },
  {
    id: 3,
    image: 'den.svg',
    contains: [ {
      id: 4,
      position: { x: 25, y: 25 },
      size: { width: 10, height: 10 }
    } ]
  },
  {
    id: 4,
    image: 'tv.svg'
  }
]
对于页面,
/areas/1
,例如:

<html><body>
  <svg from='base.svg'>
    <!-- Contents of base.svg -->
    <a xlink:href='/areas/2'>
      <svg from='kitchen.svg' x='50' y='50' width='35' height='35'>
        <!-- Contents of kitchen.svg -->
      </svg>
    </a>
    <a xlink:href='/areas/3'>
      <svg from='den.svg' x='150' y='150' width='45' height='45'>
        <!-- Contents of den.svg -->
        <a xlink:href='/areas/4'>
          <svg from='tv.svg' x='25' y='25' width='10' height='10'>
            <!-- Contents of tv.svg -->
          </svg>
        </a>
      </svg>
    </a>
  </svg>
</body></html>


除了ember是否适合SVG之外,我看不到其他问题。对我用它制作了很多SVG组件,并取得了巨大的成功。其中一些可以很好地处理ember数据,而一些取决于复杂性的数据可以通过ajax调用更好地处理。这取决于您的体系结构和数据,SVG文档不会成为模板。该组件需要加载内容并将其自身插入到该文档中以供子组件使用。这不是余烬渲染的常见模式。检查nf-graph()的一些架构,除了余烬是否适合SVG之外,我没有看到其他问题。对我用它制作了很多SVG组件,并取得了巨大的成功。其中一些可以很好地处理ember数据,而一些取决于复杂性的数据可以通过ajax调用更好地处理。这取决于您的体系结构和数据,SVG文档不会成为模板。该组件需要加载内容并将其自身插入到该文档中以供子组件使用。这不是余烬渲染的常见模式。请检查nf graph()的一些架构