Giter Site home page Giter Site logo

Comments (4)

jinmingpang avatar jinmingpang commented on September 28, 2024 1

把你需要的读取的 object 数据,用 JSON.stringify 存到一个固定 key 里,然后取的时候可以从固定的这个 key 存的 object 里支持变量取。

// 存固定值 key
localStorage.setItem("a", JSON.stringify({b: 1}))
{
  "type": "page",
  "title": "标题",
  "data": {
    "cachKey": "b"
  },
  "body": "${ls:a|pick:${cachKey}}"
}

预览图

image

from amis.

2betop avatar 2betop commented on September 28, 2024

试试这个 {ls:xxxxxlocalStrorageKey[bizKey]}

from amis.

tanjiancheng avatar tanjiancheng commented on September 28, 2024

试试这个 {ls:xxxxxlocalStrorageKey[bizKey]}
我试了好像不行,以下是我的测试语句
{
"type": "page",
"data": {
"bizKey": "test"
},
"body": [
{
"type": "tpl",
"tpl": "${ls:[bizKey]}"
}
]
}

我如果${ls:test}这样是ok的,其中localStroage是这样的
image

from amis.

tanjiancheng avatar tanjiancheng commented on September 28, 2024

请问下这块目前是什么情况了?

from amis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.