File tree 5 files changed +118
-1
lines changed
5 files changed +118
-1
lines changed Original file line number Diff line number Diff line change 4
4
"description" : " Hackable charting lib for traders" ,
5
5
"main" : " ./dist/trading-vue.js" ,
6
6
"scripts" : {
7
- "test" : " echo \" Error: no test specified \" && exit 1 " ,
7
+ "test" : " webpack-dev-server --config webpack/ test.config.js --mode development --progress --hot " ,
8
8
"dev" : " webpack-dev-server --config webpack/dev.config.js --mode development --progress --hot" ,
9
9
"build" : " webpack --config webpack/build.config.js --mode production --progress"
10
10
},
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <trading-vue :data =" chart" :width =" this.width" :height =" this.height"
3
+ :color-back =" colors.colorBack"
4
+ :color-grid =" colors.colorGrid"
5
+ :color-text =" colors.colorText" >
6
+ </trading-vue >
7
+ </template >
8
+
9
+ <script >
10
+ import TradingVue from ' ../src/TradingVue.vue'
11
+ import Data from ' ../data/data.json'
12
+ import Utils from ' ../src/stuff/utils.js'
13
+
14
+ export default {
15
+ name: ' app' ,
16
+ components: {
17
+ TradingVue
18
+ },
19
+ methods: {
20
+ onResize (event ) {
21
+ this .width = window .innerWidth
22
+ this .height = window .innerHeight
23
+ }
24
+ },
25
+ mounted () {
26
+ window .addEventListener (' resize' , this .onResize )
27
+ setTimeout (() => {
28
+ // Async data setup
29
+ this .$set (this , ' chart' , Data)
30
+ }, 0 )
31
+ },
32
+ beforeDestroy () {
33
+ window .removeEventListener (' resize' , this .onResize )
34
+ },
35
+ data () {
36
+ return {
37
+ chart: {}, // Data will be here,
38
+ width: window .innerWidth ,
39
+ height: window .innerHeight ,
40
+ colors: {
41
+ colorBack: ' #fff' ,
42
+ colorGrid: ' #eee' ,
43
+ colorText: ' #333' ,
44
+ }
45
+ };
46
+ }
47
+ };
48
+ </script >
49
+
50
+ <style >
51
+ html ,
52
+ body {
53
+ background-color : #000 ;
54
+ margin : 0 ;
55
+ padding : 0 ;
56
+ overflow : hidden ;
57
+ }
58
+ </style >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="utf-8 ">
6
+ < meta http-equiv ="x-ua-compatible " content ="ie=edge ">
7
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
8
+ < title > TradingVue.js Tests</ title >
9
+ < style >
10
+ </ style >
11
+ </ head >
12
+
13
+ < body >
14
+ <!-- Our vue app will be mounted on this DOM element -->
15
+ < div id ="app "> </ div >
16
+ <!-- Bundle will be injected below -->
17
+ </ body >
18
+
19
+ </ html >
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue' ;
2
+
3
+ import App from './Test.vue' ;
4
+
5
+ new Vue ( {
6
+ el : '#app' ,
7
+ render : h => h ( App )
8
+ } ) ;
Original file line number Diff line number Diff line change
1
+ const VueLoaderPlugin = require ( 'vue-loader/lib/plugin' )
2
+ const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
3
+
4
+ module . exports = {
5
+ entry : './test/index.js' ,
6
+ module : {
7
+ rules : [ {
8
+ test : / \. v u e $ / ,
9
+ exclude : / n o d e _ m o d u l e s / ,
10
+ loader : 'vue-loader'
11
+ } ,
12
+ {
13
+ test : / \. j s $ / ,
14
+ exclude : / n o d e _ m o d u l e s / ,
15
+ loader : 'babel-loader'
16
+ } ,
17
+ {
18
+ test : / \. c s s $ / ,
19
+ use : [
20
+ 'vue-style-loader' ,
21
+ 'css-loader'
22
+ ]
23
+ } ,
24
+ ]
25
+ } ,
26
+ plugins : [
27
+ new VueLoaderPlugin ( ) ,
28
+ new HtmlWebpackPlugin ( {
29
+ template : './test/index.html'
30
+ } )
31
+ ] ,
32
+ }
You can’t perform that action at this time.
0 commit comments