Commit 6d2e5ce5 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Setting up library like behaviour

parent 0f310e65
Pipeline #1798 failed with stage
in 1 minute and 13 seconds
......@@ -16,6 +16,7 @@
"devDependencies": {
"babel-core": "^6.24.0",
"babel-preset-latest": "^6.24.0",
"babel-polyfill": "^6.23.0",
"webpack": "^2.2.1",
"babel-loader": "^6.4.0",
......
<template>
<div>
{{ greeting }}
</div>
</template>
<script>
export default {
name: 'correlation-analysis',
data () {
return {
greeting: 'Hello World'
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
import Vue from 'vue'
import 'babel-polyfill'
import { ChartManager } from './services/chartManager'
const chartManager = new ChartManager()
function setChart (name, elementId) {
chartManager.setChart(name, elementId)
}
export { setChart }
import Vue from 'vue'
import CorrelationAnalysis from '../components/charts/CorrelationAnalysis.vue'
class ChartManager {
setChart (name, elementId) {
const charts = {'correlation-analysis': CorrelationAnalysis}
const Chart = Vue.extend(charts[name])
const vm = new Chart()
vm.$mount(elementId)
}
}
export { ChartManager }
<!doctype html>
<head>
<script src="../../lib/fractal.js"></script>
</head>
<body>
<div id="placeholder"></div>
</body>
<script>
fractal.setChart('correlation-analysis', '#placeholder')
</script>
\ No newline at end of file
const path = require('path')
module.exports = {
entry: './src/main.js',
entry: path.resolve(__dirname, 'src/main.js'),
devtool: 'source-map',
output: {
path: path.resolve(__dirname, './lib'),
path: path.resolve(__dirname, 'lib'),
library: 'fractal',
libraryTarget: 'var',
filename: 'fractal.js'
},
devtool: 'source-map',
module: {
rules: [
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment