Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode 关联本地数据 #1

Open
JustinWang0123 opened this issue Mar 28, 2018 · 1 comment
Open

VSCode 关联本地数据 #1

JustinWang0123 opened this issue Mar 28, 2018 · 1 comment

Comments

@JustinWang0123
Copy link

点击编辑器右上角的 Show Data File 按钮可以从模版文件跳转到对应的数据文件(.json),并滚动到引用该模版的位置。如果找到多个文件或位置使用该模版,会弹出选择框。

这个应该怎么配置才能关联到本地的json 数据文件呢?

@Sleen
Copy link
Member

Sleen commented Mar 28, 2018

json 数据文件中需要有以下结构:

{
    /*
     key 必须为 "templateId" / "template" / "blockId" 之一,
     value 为模版文件名,不含后缀,可以有 `xxx@` 前缀
    */
    "template": "模版名",

    /* 数据 */
    "data": {

    }
}

例:

{
  "blocks": [
    {
      "template": "TEST@header", // 对应 header.mist 文件
      "data": {}
    },
    {
      "template": "TEST@hello_world", // 对应 hello_world.mist 文件
      "data": {
        "name": "Sleen",
        "description": "some description"
      }
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants