我正在努力弄清楚如何在一个微光组件层次结构中向下实现数据,向上执行操作(使用 Ember Octane,v3.15)。
我有一个带有项目列表的父组件。当用户单击Parent组件内的按钮时,我想Editor用相关项目的数据填充组件;当用户在Editor组件中单击“保存”时,将更改填充回父级。下面是发生的情况:
如何让文本框填充“Hello”,并在单击“保存”时将更改保留回上面的列表?
{{!-- app/components/parent.hbs --}}
<ul>
{{#each this.models as |model|}}
<li>{{model.text}} <button {{on 'click' (fn this.edit model)}}>Edit</button></li>
{{/each}}
</ul>
<Editor @currentModel={{this.currentModel}} @save={{this.save}} />
Run Code Online (Sandbox Code Playgroud)
{{!-- app/components/parent.hbs --}}
<ul>
{{#each this.models as |model|}}
<li>{{model.text}} <button {{on 'click' (fn this.edit model)}}>Edit</button></li>
{{/each}}
</ul>
<Editor @currentModel={{this.currentModel}} @save={{this.save}} />
Run Code Online (Sandbox Code Playgroud)
{{!-- app/components/editor.hbs --}}
{{#if @currentModel}}
<small>Editing ID: {{this.id}}</small>
{{/if}}
<Input @value={{this.text}} />
<button {{on 'click' this.save}}>Save</button>
Run Code Online (Sandbox Code Playgroud)
// app/components/parent.js
import Component from '@glimmer/component';
export default class ParentComponent …Run Code Online (Sandbox Code Playgroud) 我试图绘制three.js所用不同的颜色不同的顶点的线,使用THREE.Line和THREE.LineBasicMaterial与vertexColors设置为THREE.VertexColors.我希望相邻顶点的颜色之间没有插值(这样颜色只是在两个顶点之间的中点处不连续变化).
我尝试设置shading: THREE.FlatShading材料,但我现在意识到这不是一个选项LineBasicMaterial:http://jsfiddle.net/214huf0a/
是否有内置(或简单)方法来防止Three.js中一行上的点之间的颜色平滑,或者我是否需要编写自己的着色器?