Skip to content

Commit 2ec6dfb

Browse files
committed
component-03
1 parent 6ba4f07 commit 2ec6dfb

10 files changed

+163
-10
lines changed

.travis.yml

+24-10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ before_install:
4141
jobs:
4242
include:
4343

44+
- stage: test
45+
name: component-03
46+
env:
47+
- SUB_PROJECT=component-03
48+
before_script:
49+
- cd $TRAVIS_BUILD_DIR/$SUB_PROJECT && npm i -E
50+
- cd $TRAVIS_BUILD_DIR/$SUB_PROJECT && npm start
51+
- cd $TRAVIS_BUILD_DIR/$SUB_PROJECT && npm run logs &
52+
- wait_for 1234
53+
script:
54+
- http :1234
55+
after_script:
56+
- cd ${root}/vuesax-example && npm stop
57+
4458
- stage: test
4559
name: component-02-in-browser-in-html
4660
env:
@@ -219,15 +233,15 @@ jobs:
219233
- if [ -f npm-debug.log ]; then cat npm-debug.log; fi;
220234
- npm run build -- --report
221235

222-
- stage: test
223-
node_js: lts/*
224-
name: todo-list
225-
script:
226-
- cd ${root}/todo-list
227-
- npm install
228-
- npm run predeploy
229-
- if [ -f npm-debug.log ]; then cat npm-debug.log; fi;
230-
- npm run build -- --report
236+
# - stage: test
237+
# node_js: lts/*
238+
# name: todo-list
239+
# script:
240+
# - cd ${root}/todo-list
241+
# - npm install
242+
# - npm run predeploy
243+
# - if [ -f npm-debug.log ]; then cat npm-debug.log; fi;
244+
# - npm run build -- --report
231245

232246
# - stage: test
233247
# node_js: lts/*
@@ -339,7 +353,7 @@ jobs:
339353

340354
- stage: deploy
341355
env:
342-
- SUB_PROJECT=component-02-in-browser-in-html
356+
- SUB_PROJECT=component-03
343357
- secure: oP/muOICK9B+4eYo8V8AQJqJ0iqy2n9s2n+5XUJPDJh04PZdG/jRp5mpoHATdSqrCEoREuvP1HAww8mNCiZRjN1pMbKE6v6LvtuRYURpm3Uctnbgf6m3pA95upcf48TsHLPr30seQge0lwR39dx+PQ0bbsfywR81MzPu+gT2ExbxMg70MOOf2tILIGAPKkk/Zishf7an17VzgFDJZLLq8fZaKFbFE5jgA5OMU7lgSUrQadhXTgRWT6kUmt7pPByovLinzBZVl/wBbyoxcxF3HSNaLcUSgWXDTDfQHeRDblS78ERtQ+ywBEN9dPv9cwTrxgZcr5laAQjIJ22HNGyLT2gxodlxRs3awp7zY2aNsdcrnbNNSTh2gfZ2r3yd/CDkuNU46W5QsfLpvEgJlacle4JM91afCoYj2OFFSx09UHfp9kPbRwuXerhgIWuYGUwQ15dXR0csxxqLJYslDK8XucKGrPIxo8gi4+/cKeKLotR7b5VXEjdrZtRfnbWU4htYMcb+1nGItKmYyK2eFb4ShOhS2lXRhEGwzAOhn8C5MGKdABpaPLcBHcAyUpGFl76B4nRU4kXKyKPKBJoBs36eZMBYgsiKwZ8UD9id0WIHLAQInbXzvh4SbmClJV4SFwcIroKkGv+iQdRvFA21d0v1teYTHAeHot4bKVGVEaODP/M=
344358
name: GitHub pages deployment
345359
script: skip

README.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ This repository is contains some Vue.js playground project examples
3535

3636
== links
3737

38+
- link:https://github.com/vuejs/vue-cli/issues/1198#issuecomment-385340314[Vue + TS cannot resolve module TS2307 error fix]
39+
- https://parceljs.org/vue.html
40+
- https://parceljs.org/recipes.html#vue
3841
- link:https://vue-composition-api-rfc.netlify.com/#summary[Vue Composition API]
3942
- link:https://ru.vuejs.org/v2/guide/syntax.html[Vue in browser]
4043
- link:https://metanit.com/[rubooks]

component-03/package.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "vue-examples",
3+
"version": "1.0.0",
4+
"description": "Starter",
5+
"main": "src/index.html",
6+
"scripts": {
7+
"gh": "npm run build -- --public-url='/vue-examples/'",
8+
"build": "parcel build src/index.html --no-cache",
9+
"start": "pm2 start 'npm run dev' --name app",
10+
"dev": "parcel src/index.html --open --no-cache",
11+
"restart": "pm2 restart app",
12+
"stop": "pm2 kill",
13+
"logs": "pm2 logs"
14+
},
15+
"keywords": [
16+
"pm2",
17+
"parcel",
18+
"starter"
19+
],
20+
"author": "daggerok",
21+
"license": "MIT",
22+
"devDependencies": {
23+
"@types/node": "13.1.4",
24+
"@types/vue": "2.0.0",
25+
"@vue/component-compiler-utils": "3.1.1",
26+
"parcel-bundler": "1.12.4",
27+
"pm2": "4.2.1",
28+
"pug": "^2.0.4",
29+
"sass": "^1.24.3",
30+
"typescript": "3.7.4",
31+
"vue-template-compiler": "2.6.11",
32+
"webfontloader": "1.6.28"
33+
},
34+
"dependencies": {
35+
"vue": "2.6.11",
36+
"vue-hot-reload-api": "2.3.4"
37+
}
38+
}

component-03/src/ClickerCounter.vue

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template>
2+
<div>
3+
<button @click="increment">
4+
<Other ></Other>
5+
clicked {{ counter }} times
6+
</button>
7+
</div>
8+
</template>
9+
10+
<script>
11+
import Other from './Other';
12+
13+
export default {
14+
name: 'ClickerCounter',
15+
components: {
16+
Other,
17+
},
18+
data() {
19+
return { counter: 0 };
20+
},
21+
methods: {
22+
increment() {
23+
this.counter += 1;
24+
},
25+
},
26+
};
27+
</script>
28+
29+
<style scoped>
30+
button {
31+
color: green;
32+
padding: 2%;
33+
margin: 2%;
34+
font-size: 3em;
35+
}
36+
</style>

component-03/src/Other.vue

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template lang="pug">
2+
.container Hello {{ bundler }}!
3+
</template>
4+
5+
<script lang="ts">
6+
import Vue from 'vue';
7+
8+
export default Vue.extend({
9+
data() {
10+
return {
11+
bundler: 'Parcel'
12+
};
13+
},
14+
});
15+
</script>
16+
17+
<style lang="scss" scoped>
18+
.container {
19+
color: green;
20+
}
21+
</style>

component-03/src/favicon.ico

1.12 KB
Binary file not shown.

component-03/src/index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport"
6+
content="width=device-width initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Vue examples</title>
9+
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
10+
</head>
11+
<body>
12+
13+
<div id="app">
14+
<clicker></clicker>
15+
</div>
16+
17+
<script src="./main.js"></script>
18+
</body>
19+
</html>

component-03/src/main.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import './webfontloader.ts';
2+
import Vue from 'vue';
3+
import ClickerCounter from './ClickerCounter.vue';
4+
5+
new Vue({ render: createElement => createElement(ClickerCounter) })
6+
.$mount('#app');

component-03/src/webfontloader.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
body {
2+
font-family: Roboto, sans-serif;
3+
padding: 0;
4+
margin: 0;
5+
}

component-03/src/webfontloader.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import './webfontloader.css';
2+
import WebFont from '../node_modules/webfontloader';
3+
4+
WebFont.load({
5+
google: {
6+
families: [
7+
// 'Roboto:300,400,500,600,700',
8+
'Roboto:400,100,‌​100italic,300,300ita‌​lic,400italic,500,50‌​0italic,700,700itali‌​c,900italic,900',
9+
],
10+
},
11+
});

0 commit comments

Comments
 (0)