Giter Site home page Giter Site logo

Comments (3)

findreamer avatar findreamer commented on May 1, 2024 1

@cic1988 呃,你这个示例代码不是单页应用啊,只是应用了Page组件,单页应用应该使用App组件(amis官网-组件- App),可参考源码示例:https://github.com/baidu/amis/blob/master/examples/app/index-vite.html,

from amis.

findreamer avatar findreamer commented on May 1, 2024

问题1:params没有更新的原因是,这里url发生变化,当发现匹配的是相同的页面时,直接就退出了,没有更新到params参数,这里能否提交一个PR处理一下。
截屏2024-01-02 18 10 20

packages/amis-core/src/store/app.ts

问题2:query未获取到的原因是,App 组件的父组件高阶组件HocStoreFactory 在 componentDidUpdate生命周期中有更新 IRenderer.data 逻辑(更新query数据),react组件的 componentDidUpdate 执行顺序是子组件 > 父组件,也就是说 location发生变化时,App组件会先执行render函数,但是从store.PageData中获取到的数据仍未更新。

from amis.

cic1988 avatar cic1988 commented on May 1, 2024

你好 @findreamer 。 请教一下, 我现在的情况和问题里的情况有点不一样。我使用的是单页应用。请问如何动态跳转到一个新页面,而这个新页面就想你在视频里面一样是显示在同一个内嵌页面里面呢?十分感谢。

<body>
    <div class="amiss" id="amisId"></div>
    <script type="text/javascript">
        (function () {
            let amis = amisRequire('amis/embed');
            let current_time = "{{ current_time }}";
            let amisInstance = amis.embed(
                '#amisId',
                {
                    "type": "page",
                    "title": "新页面",
                    "body": [
                        {
                            "type": 'button',
                            "actionType": 'link',
                            "link": "./simple.html/detail",
                            "label": 'jump to detail page',
                            "level": 'primary'
                        }
                    ]
                },
                { locale: "zh-CN" },
                { theme: "cxd" }
            );
        })();
    </script>
</body>

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.