簡體   English   中英

VS2015 Typescript:在中啟用JointJs grig

[英]VS2015 Typescript: enable JointJs grig in

我想知道如何在VS2015中通​​過Typescript啟用jointjs插件網格。 我嘗試在jointjs.d.ts的IOptions接口中添加屬性drawGrid,並且在.ts文件中設置屬性后:

 //Create Paper Option
 var viewopt = new Backbone.View();
 viewopt.el = $('#paper');
 viewopt.model = this.graph;
 viewopt.attributes = { gridSize: 50, drawGrid: true };
 //Create Paper
 this.paper = new joint.dia.Paper(viewopt);

在我的.js輸出文件中,我看到了該屬性,但是紙張始終沒有網格。 你可以幫幫我嗎。 非常感謝

gridSize是紙張選項(不適用於網格)。 而且viewopt不必是Backbone View,一個普通的對象也可以。

var paper = new joint.dia.Paper({
    el: $('#paper'),
    width: 600,
    height: 400,
    gridSize: 10,
    drawGrid: true,
    model: graph
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM