Skip to content

Commit

Permalink
avalon components template
Browse files Browse the repository at this point in the history
  • Loading branch information
Levan-Du committed Apr 5, 2017
1 parent 82147b3 commit 2af6bd6
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
36 changes: 20 additions & 16 deletions build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ return __webpack_require__(__webpack_require__.s = 16);
/******/ })
/************************************************************************/
/******/ ([
Expand Down Expand Up @@ -7982,7 +7982,7 @@ module.exports = g;
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Hello__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Hello__ = __webpack_require__(15);



Expand All @@ -7991,7 +7991,7 @@ module.exports = g;
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__app__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__app__ = __webpack_require__(17);



Expand Down Expand Up @@ -10112,6 +10112,12 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {

/***/ }),
/* 10 */
/***/ (function(module, exports) {

module.exports = "<h2 class=${style.redHello} ms-click=@change>Hello {{@word}}</h2>"

/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

/*
Expand Down Expand Up @@ -10148,7 +10154,7 @@ var stylesInDom = {},
singletonElement = null,
singletonCounter = 0,
styleElementsInsertedAtTop = [],
fixUrls = __webpack_require__(11);
fixUrls = __webpack_require__(12);

module.exports = function(list, options) {
if(typeof DEBUG !== "undefined" && DEBUG) {
Expand Down Expand Up @@ -10407,7 +10413,7 @@ function updateLink(linkElement, options, obj) {


/***/ }),
/* 11 */
/* 12 */
/***/ (function(module, exports) {


Expand Down Expand Up @@ -10502,7 +10508,7 @@ module.exports = function (css) {


/***/ }),
/* 12 */
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag
Expand All @@ -10511,7 +10517,7 @@ module.exports = function (css) {
var content = __webpack_require__(7);
if(typeof content === 'string') content = [[module.i, content, '']];
// add the styles to the DOM
var update = __webpack_require__(10)(content, {});
var update = __webpack_require__(11)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
Expand All @@ -10528,21 +10534,19 @@ if(false) {
}

/***/ }),
/* 13 */
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_avalon2__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_avalon2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_avalon2__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hello_css__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hello_css__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hello_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__hello_css__);



__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_avalon2__["component"])('ms-hello', {
template: `
<h2 class=${__WEBPACK_IMPORTED_MODULE_1__hello_css___default.a.redHello} ms-click="@change">Hello {{@word}}</h2>
`,
template: __webpack_require__(10),
defaults: {
word: 'China',
change: function(e) {
Expand All @@ -10553,16 +10557,16 @@ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_avalon2__["component"])('ms-he


/***/ }),
/* 14 */
/* 15 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hello__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hello__ = __webpack_require__(14);



/***/ }),
/* 15 */
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Expand All @@ -10573,7 +10577,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });


/***/ }),
/* 16 */
/* 17 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Expand Down
16 changes: 1 addition & 15 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Avalon联系项目</title>
</head>

<body ms-controller="app">
<article>
<h1>{{@h1}}</h1>
</article>
<script type="text/javascript" src="bundle.js"></script></body>

</html>
<!DOCTYPE html><html><head><meta charset=utf-8><title>Avalon联系项目</title></head><body ms-controller=app><article><h1>{{@h1}}</h1></article><script type="text/javascript" src="bundle.js"></script></body></html>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"license": "ISC",
"devDependencies": {
"css-loader": "^0.27.3",
"html-minify-loader": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"raw-loader": "^0.5.1",
"style-loader": "^0.16.0",
"webpack": "^2.3.2",
"webpack-dev-server": "^2.4.2"
Expand Down
1 change: 1 addition & 0 deletions src/components/Hello/hello.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h2 class=${style.redHello} ms-click="@change">Hello {{@word}}</h2>
4 changes: 1 addition & 3 deletions src/components/Hello/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import avalon, { component } from 'avalon2';
import style from './hello.css';

component('ms-hello', {
template: `
<h2 class=${style.redHello} ms-click="@change">Hello {{@word}}</h2>
`,
template: require('./hello.html'),
defaults: {
word: 'China',
change: function(e) {
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
},
module: {
loaders: [{
test: /\.html$/,
loader: 'raw-loader!html-minify-loader'
}, {
test: /\.css$/,
loader: 'style-loader!css-loader?modules'
}]
Expand Down

0 comments on commit 2af6bd6

Please sign in to comment.