Giter VIP home page Giter VIP logo

Comments (6)

zaxlct avatar zaxlct commented on September 13, 2024

push.js怎么调用,很困惑

from sui-mobile.

Mickey- avatar Mickey- commented on September 13, 2024

SUI-Mobile 目前已经不再使用push.js,换了另外一套路由体系。
在官网文档里也有说明 http://m.sui.taobao.org/components/#router
image

from sui-mobile.

zaxlct avatar zaxlct commented on September 13, 2024

感谢作者的回复,谢啦~
今天一整天都在看官网文档,并在用它搭建一个千牛H5项目。

路由看了好几遍,ajax页面没看明白,我是这么理解的:
假如index.html 里有 "<"a href="/docs-demos/router2">ajax加载新页面<"/a>"
同级目录下,docs-demos.html 的body里有“<”div class="page" id='router2'>内容内容<"/div>”
结果点击a链接没有用

假如底部有四个工具栏,在参考文档里找了很久没有找到怎么用路由切换工具栏的方法
只好用最笨的方式解决,写了四个一模一样的页面来切换

看到了下拉刷新的介绍,假如顶部有一个刷新按钮,怎么能实现点击刷新呢?

很小白的问题,困扰了我一天 = =!希望作者闲暇之时稍微点拨下,很感谢,很感谢~

from sui-mobile.

QzhouZ avatar QzhouZ commented on September 13, 2024

@zaxlct
所有加载的页面,页面里面的元素好像都要放在body里,
刷新的话,我给你个建议,点击刷新,ajax拿到数据,替换数据内容了就可以了啊
另外工具栏切换,你有找到方法吗,点击对应的栏目导航和主体部分都需要切换

from sui-mobile.

zaxlct avatar zaxlct commented on September 13, 2024

@QzhouZ
多谢提供刷新的方法
切换工具栏目前还没找到方法 ,纠结好久了,现在所有的页面都放在一个html文件里,加载起来会很慢

from sui-mobile.

Mickey- avatar Mickey- commented on September 13, 2024

如果各个视图大都是异步获取内容js组装的,可以将各个.page内联到主页面里。

如果各个视图里内容都是同步写在html模板里的,是可能会造成主页面html多大,此时可以考虑将web app还原成普通web page,写成普通的a标签链接,只要没有加.external,sm会自己异步获取远端页面,取里面.page的部分插到页面里。注意这里有跨域限制

from sui-mobile.

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.