0
我使用,充分地享受knockout.js和脚本#Knockout.js和ScriptSharp - 可写入相关观测量
的邪恶组合在探索相关观测量的力量,我已经遇到需要实施documentation
中提到的可写变体如何在脚本Sharp导入类中捕获此ko函数?
我使用,充分地享受knockout.js和脚本#Knockout.js和ScriptSharp - 可写入相关观测量
的邪恶组合在探索相关观测量的力量,我已经遇到需要实施documentation
中提到的可写变体如何在脚本Sharp导入类中捕获此ko函数?
我最终制作了一个新的“导入库”项目 并定义了缺失的部分。
namespace KnockoutApi
{
[Imported]
[IgnoreNamespace]
[ScriptName("ko")]
public static class Ko
{
/// <summary>
/// Creates an observable with a value computed from one or more other values.
/// </summary>
/// <typeparam name="T">The type of the observable value.</typeparam>
/// <param name="options">Options for the dependent observable.</param>
public static DependentObservable<T> DependentObservable<T>(DependentObservableWritableOptions<T> options)
{
return null;
}
}
}
[IgnoreNamespace]
[Imported]
[ScriptName("Object")]
public class DependentObservableWritableOptions<T>
{
public DependentObservableWritableOptions()
{ }
// Summary:
// Gets or sets whether the evaluation should be deferred, i.e. not performed
// when the observable is first created.
[IntrinsicProperty]
public bool DeferEvaluation { get; set; }
//
// Summary:
// Gets or sets the function to compute the value.
[ScriptName("read")]
[IntrinsicProperty]
public Func<T> GetValueFunction { get; set; }
//
// Summary:
// Gets or sets the function to compute the value.
[ScriptName("write")]
[IntrinsicProperty]
public Action<T> SetValueFunction { get; set; }
//
// Summary:
// Gets the model instance which acts as 'this' in the get value function.
[IntrinsicProperty]
[ScriptName("owner")]
public object Model { get; set; }
}
你应该通过github上的git仓库将这个回馈给项目。它可能会帮助其他人...... –