Main.ts
var music = new Music;
this.addChild(music)
this.once(egret.TouchEvent.TOUCH_BEGIN,function(){
music.stop();
music.play();
},this)
class Main extends egret.DisplayObjectContainer { | |
private loadingView: LoadingUI; | |
static stageWidth: number; | |
static stageHeight: number; | |
public constructor() { | |
super(); | |
Main.ts
var music = new Music;
this.addChild(music)
this.once(egret.TouchEvent.TOUCH_BEGIN,function(){
music.stop();
music.play();
},this)
一篇讨论 webpack 和 rollup 的文章 https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c
pkg.module 也很重要
:global(.xxx){...}
), .xxx
不会被解析成 hash,可以在组件中 className="xxx"
使用.yyy{...}
) ,在组件中 styleName="yyy" 使用
common.css: global-style
:global(.xxx) {
...
import { combineReducers } from 'redux'; | |
import globalDate from 'reducers/globalDate' | |
import permission from 'reducers/permission' | |
const createReducer = function (reducers) { | |
return combineReducers({ | |
/* 公共 reducers,无论一开始在哪个路由下,都会载入 */ | |
globalDate, |
<Router>
<div className="router-container">
<Route exact path="/" component={ Home } />
<Route exact path="/search" component={ Search } />
</div>
</Router>
比如现在搜索要搜 t: text
和 s: abc
,路由应该是 /search?t=text&s=abc
| - your-theme
| - images # 主题相关图片资源
| - header.php # html 头部模板
| - footer.php # html 尾部模板
| - index.php # 首页模板
| - single.php # 文章模板
| - page.php # 页面模板
| - style.css
import 'package:flutter/material.dart'; | |
Widget helloRect() { | |
return Container( | |
color: Colors.purple, | |
width: 200, | |
height: 200, | |
margin: EdgeInsets.all(16), | |
child: Center(child: Text('Hi')), | |
); |