Giter Club home page Giter Club logo

mogo-h5plus's Introduction

mogo-h5plus's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mogo-h5plus's Issues

tabBar的页面切换该怎么做?

打开新的窗口可以用openWebview,首页的tabbar导航切换用什么呢?
ps: detail.vue中的路由操作有点模棱两可,没配置路由,点击也没反应
onClickCart() {
this.$router.push("cart");
},

关于调试编译非常慢的解决方案

在此之前我给出过一些优化方案,但可能比较不明显.
这次应该是终极大招了
以下数据是31个页面的测试数据(2015版乞丐mbp测试)

/ 整体编译时间 保存调试时间
使用前 48s 32s
使用后 50s 3s

使用方法

npm i  html-webpack-plugin-for-multihtml -D

// 安装完成后 前往 /build/multipage.js 


// 将
const HtmlWebpackPlugin = require("html-webpack-plugin");
// 改为
const HtmlWebpackPlugin = require("html-webpack-plugin-for-multihtml");

// 然后`HtmlWebpackPlugin`下面的代码中添加

 new HtmlWebpackPlugin({
       ....,
       multihtmlCache:true,  
    })

谢谢使用和issue

vue 多页面 vs vue单页面

关于性能方面,从http://ask.dcloud.net.cn/article/25 看到了如下话:

不管使用哪种方法,都要注意一点,手机App的HTML页面必须本身性能足够高。

这是老生常谈的问题,但现实中还是大量App因为这个问题而导致性能体验出问题。
编写干净整洁、一次渲染的页面非常重要。
现在太多开发者在研究模式、框架,让页面渲染要经历二次、甚至四五次重绘才能完成。在短短几百毫秒的动画期间,这么干要不让页面卡、要不让渲染慢。
减少js二次渲染很重要的就是减少使用js渲染页面,页面结构要用简单朴素的HTML写,js可以动态填充数据,但如果js动态绘制页面主体,那渲染速度上不去。
减少css二次渲染,就是少用复杂的选择器,少用padding、margin这些会二次修正页面的css。
如果追求极致的话,那jquery、zepto这些框架也不要使用,手机上都是webkit引擎,直接写document的api操作dom即没有兼容问题又没有效率问题。

采用vue多页面是不是有点违背上面所说的这些话了,您之前考虑过vue的单页面吗?有什么缺点吗?

“再按一次退出应用”的问题

“再按一次退出应用”原本在mui中已经写好了的。我在APP组件中使用了mui,其他页面都没使用。
在安卓手机上按返回键时,应用弹出了提示“再按一次退出应用”的同时也一并退出了!
这是怎么回事,如何破?

浏览器运行报错:plus is not defined

GET html5plus://ready net::ERR_UNKNOWN_URL_SCHEME
runtime.js?91ec:3 Uncaught (in promise) ReferenceError: plus is not defined
at eval (runtime.js?91ec:3)
at F (_export.js?90cd:36)
at getProperty (runtime.js?91ec:2)
at VueComponent.created (logo.vue?ad85:25)
at callHook (vue.esm.js?efeb:2921)
at VueComponent.Vue._init (vue.esm.js?efeb:4630)
at new VueComponent (vue.esm.js?efeb:4798)
at createComponentInstanceForVnode (vue.esm.js?efeb:4310)
at init (vue.esm.js?efeb:4131)
at createComponent (vue.esm.js?efeb:5608)
(anonymous) @ runtime.js?91ec:3
F @ _export.js?90cd:36
getProperty @ runtime.js?91ec:2
created @ logo.vue?ad85:25
callHook @ vue.esm.js?efeb:2921
Vue._init @ vue.esm.js?efeb:4630
VueComponent @ vue.esm.js?efeb:4798
createComponentInstanceForVnode @ vue.esm.js?efeb:4310
init @ vue.esm.js?efeb:4131
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
createChildren @ vue.esm.js?efeb:5682
createElm @ vue.esm.js?efeb:5584
createChildren @ vue.esm.js?efeb:5682
createElm @ vue.esm.js?efeb:5584
patch @ vue.esm.js?efeb:6091
Vue._update @ vue.esm.js?efeb:2660
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
Watcher @ vue.esm.js?efeb:3131
mountComponent @ vue.esm.js?efeb:2795
Vue.$mount @ vue.esm.js?efeb:8540
Vue.$mount @ vue.esm.js?efeb:10939
init @ vue.esm.js?efeb:4137
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
createChildren @ vue.esm.js?efeb:5682
createElm @ vue.esm.js?efeb:5584
patch @ vue.esm.js?efeb:6091
Vue._update @ vue.esm.js?efeb:2660
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
Watcher @ vue.esm.js?efeb:3131
mountComponent @ vue.esm.js?efeb:2795
Vue.$mount @ vue.esm.js?efeb:8540
Vue.$mount @ vue.esm.js?efeb:10939
init @ vue.esm.js?efeb:4137
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
patch @ vue.esm.js?efeb:6130
Vue._update @ vue.esm.js?efeb:2660
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
Watcher @ vue.esm.js?efeb:3131
mountComponent @ vue.esm.js?efeb:2795
Vue.$mount @ vue.esm.js?efeb:8540
Vue.$mount @ vue.esm.js?efeb:10939
Vue._init @ vue.esm.js?efeb:4640
Vue @ vue.esm.js?efeb:4729
(anonymous) @ main.js?1c90:45
./src/main.js @ index.js:577
webpack_require @ vue.js:713
fn @ vue.js:118
0 @ index.js:611
webpack_require @ vue.js:713
webpackJsonpCallback @ vue.js:26
(anonymous) @ index.js:1
vconsole.min.js?2f0e:11 [HMR] Waiting for update signal from WDS...
vconsole.min.js?2f0e:11 [Vue warn]: Error in created hook: "ReferenceError: plus is not defined"

found in

---> at src\App.vue

value @ vconsole.min.js?2f0e:11
value @ vconsole.min.js?2f0e:11
value @ vconsole.min.js?2f0e:11
value @ vconsole.min.js?2f0e:11
value @ vconsole.min.js?2f0e:11
value @ vconsole.min.js?2f0e:10
value @ vconsole.min.js?2f0e:10
i @ vconsole.min.js?2f0e:10
vconsole.min.js?2f0e:11 ReferenceError: plus is not defined
at eval (webpack-internal:///./src/utils/webview.js:71:5)
at Array.map (native)
at preLoad (webpack-internal:///./src/utils/webview.js:67:12)
at VueComponent.created (webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules…odules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue:143:77)
at callHook (webpack-internal:///./node_modules/vue/dist/vue.esm.js:2920:21)
at VueComponent.Vue._init (webpack-internal:///./node_modules/vue/dist/vue.esm.js:4629:5)
at new VueComponent (webpack-internal:///./node_modules/vue/dist/vue.esm.js:4797:12)
at createComponentInstanceForVnode (webpack-internal:///./node_modules/vue/dist/vue.esm.js:4309:10)
at init (webpack-internal:///./node_modules/vue/dist/vue.esm.js:4130:45)
at createComponent (webpack-internal:///./node_modules/vue/dist/vue.esm.js:5607:9)

...extraEntry语法错

我npm start的时候,报这个语法错,这个是es6的语法。我需要怎么配置呀。
webpack.config.js:37
...extraEntry
^^^
SyntaxError: Unexpected token ...

怎么阻止页面返回?

比如在打开首页发现用户没登录时,跳转到登录页,那怎么防止用户再退回到首页?
是在登录页监听安卓返回键吗?还是有其他的方法?

下载node_module后 npm run dev后报错

[nodemon] 1.17.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
/Users/cloverliang/Documents/练习/MogoH5+/mogo-h5plus-master/build/webpack.base.conf.js:48
    ...extraEntry
    ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/cloverliang/Documents/练习/MogoH5+/mogo-h5plus-master/build/webpack.dev.conf.js:7:27)
[nodemon] app crashed - waiting for file changes before starting...

image

打开webview的时候速度特别慢。

不管是plus.webview.create还是plus.webview.open,页面内容渲染的速度都很慢,
我在考虑会不会受这几个原因影响:
1.我使用的vuex
2.我的webview没有使用原生titleNView,都是写在各个页面中
3.我的一些ajax数据加载写在created生命周期中,使用axios,用async await来处理异步
请问上面的这几个原因会导致非常严重的性能问题吗?或者是其他原因导致的?因为我的页面渲染速度真的是慢到有点不能接受,用户体验极差,比你的demo慢很多。
PS:相同页面打开过一次,第二次打开会快一些

Syntax Error: Unexpected token (93:2)

node 10.6.0 报这个错是什么问题
Syntax Error: Unexpected token (93:2)
const Props = {

...props(),
^
title: {
type: String,
required: true

webview.setStyle 不起作用????

var curWebview = window.plus.webview.getLaunchWebview();
console.log(curWebview);
curWebview.setStyle({
titleNView: {
backgroundColor: "#1AAD19", // 导航栏背景色
titleText: "学习助手", // 导航栏标题
titleColor: "#FEFEFE", // 文字颜色
type: "transparent", // 透明渐变样式
autoBackButton: false, // 自动绘制返回箭头
splitLine: {
color: "#cccccc" // 底部分割线
}
},
statusbar: {
background: '#1AAD19'
}
})

这段代码打死都不起作用

页面多了以后,编译速度特别慢

页面多了以后(40多个页面),编译速度特别慢。vue文件修改一下编译就得起码2分钟,而且很大概率奔溃报错。非常影响开发,希望可以改善

请问路由openWebview中的html地址是怎么来的。

openWebview(
{
url: "./map/map.html",
id: "./map/map.html"
},
{
bounce: "none"
}
);
::: tip 路由
遵循相对路径原则,如果在src访问这个页面则就是./goods/list.html
!!! 后缀一定是.html
:::
tip没看懂,这个路径和这个html是怎么得出的

用 h5plus 做了个页面侧滑返回的方法,但是点击返回按钮返回不成功,请问怎么办?

用的侧滑返回 方法是
将全局变量 ws 赋值为当前页面对象,
在点击事件内
plus.webview.open() 创建的页面,通过 drag 方法实现侧滑返回
遇到的问题,自己手写的 navbar 组件将组件引入后,单击组件上的返回按钮不返回
尝试过的方法,1. $router.push() // 不生效
2.window.history.go(-1) // 不生效
3. $router.go(-1) 不生效
4. plus.webview.close ()
5. plus.webview.hide()
关闭和隐藏的方法 会直接白屏
6. plus.webview.open() // 上一个页面将上一个页面新建成一个页面,发现一旦有层级时,侧滑返回的事件,失效
7. 从A跳转到B,从B跳转到C,在C创建新页面B,并增加侧滑返回事件,链接写的A页面,发现当进入到了B页面,侧滑返回的不是A页面,而是C页面

求大神给个思路,拜托了。

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.