Comments (6)
由于开发者在模板上书写directive的顺序是随机的,但某些directive间是有依赖关系或必须优先执行,所以会依据priority排序来执行directive。
例如if优先级较高,决定了后面要不要继续执行其他directive
这个priority你可以参考avalon源码里面的directive是怎样使用的
from avalon2-webpack2-spa.
还有我发现一个情况,不知道是不是bug。我在win7的虚拟机中,down下了项目,build以后,用nginx做了映射后,ie8打开一片空白,也不报错。用开发dev命令启动,依然一片空白,但是当我打开开发者工具再刷新,页面就正常加载了,这个是啥原因?
from avalon2-webpack2-spa.
这个是因为ie8-没有console,我看了一下是eventsource-polyfill这个引起的。
broswerify-eventsource.js里面改一下就好
if (window.console){
console.log("polyfill-eventsource added missing EventSource to window");
}
eventsource-polyfill只有在dev下用到
至于build后显示空白是因为你没有修改config/index.js配置中的assetsPublicPath,这个决定了拉取资源的相对路径,项目由于是发布到github上,所以
assetsPublicPath: '/avalon2-webpack2-spa/'
你本地的话改成这样就行了
assetsPublicPath: '/'
from avalon2-webpack2-spa.
你好~周末快乐。
我在实践框架的时候,遇到了一点问题,想跟你询问一下。
就是路由跳转的api是哪个方法?我看了mmRouter的文档,里面只写了一个avalon.router.navigator()但这个方法发现虽然页面跳转了,可是地址栏并没有改变,我想问,是有其他更合适的方法么?
from avalon2-webpack2-spa.
使用avalon.router.navigate的第二个参数
/*
* @interface avalon.router.navigate 设置历史(改变URL)
* @param hash 访问的url hash
*/
navigate: function (hash, mode) {
...
// 模式0, 不改变URL, 不产生历史实体, 执行回调
// 模式1, 改变URL, 不产生历史实体, 执行回调
// 模式2, 改变URL, 产生历史实体, 执行回调
if (mode === 1) {
avalon.history.setHash(hash, true)
} else if (mode === 2) {
avalon.history.setHash(hash)
}
...
}
from avalon2-webpack2-spa.
3Q~
from avalon2-webpack2-spa.
Related Issues (10)
- Object.defineProperty() IE8 兼容你是如何处理的? HOT 2
- 感激!这就是我寻寻觅觅的神器
- 运行不了
- 关于组件样式 HOT 6
- 你好,请问,你这个脚手架,是否支持IE8? HOT 5
- 你好,我又来了😁 HOT 3
- 匹配动态路由的时候匹配不上 HOT 1
- 我install那个avalon都成功不了 HOT 2
- 关于路由跳转 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalon2-webpack2-spa.